Merge pull request #27 from mcleary/prevent-crash-when-exiting

Fix crash when running Tracy from DLLs
This commit is contained in:
Bartosz Taudul 2020-05-21 15:32:29 +02:00 committed by GitHub
commit 41972f62a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1468,6 +1468,7 @@ _memory_deallocate_large(span_t* span) {
//Investigate if it is better to defer large spans as well through span_cache_deferred, //Investigate if it is better to defer large spans as well through span_cache_deferred,
//possibly with some heuristics to pick either scheme at runtime per deallocation //possibly with some heuristics to pick either scheme at runtime per deallocation
heap_t* heap = get_thread_heap(); heap_t* heap = get_thread_heap();
if (!heap) return;
#if ENABLE_ADAPTIVE_THREAD_CACHE || ENABLE_STATISTICS #if ENABLE_ADAPTIVE_THREAD_CACHE || ENABLE_STATISTICS
size_t idx = span->span_count - 1; size_t idx = span->span_count - 1;
atomic_decr32(&span->heap->span_use[idx].current); atomic_decr32(&span->heap->span_use[idx].current);