fix for disabled thread cache
diff --git a/rpmalloc/rpmalloc.c b/rpmalloc/rpmalloc.c
index 28d46dd..15879bf 100644
--- a/rpmalloc/rpmalloc.c
+++ b/rpmalloc/rpmalloc.c
@@ -1375,12 +1375,14 @@
 
 	_rpmalloc_heap_finalize(heap);
 
+#if ENABLE_THREAD_CACHE
 	for (size_t iclass = 0; iclass < LARGE_CLASS_COUNT; ++iclass) {
 		span_t* span = heap->span_cache[iclass];
 		heap->span_cache[iclass] = 0;
 		if (span)
 			_rpmalloc_span_list_unmap_all(span);
 	}
+#endif
 
 	if (heap->full_span_count) {
 		--heap->finalize;