diff --git a/lib/Remotery.c b/lib/Remotery.c index 8a1d136..d50223c 100644 --- a/lib/Remotery.c +++ b/lib/Remotery.c @@ -7049,6 +7049,8 @@ static void Remotery_Destructor(Remotery* rmt) // Join the remotery thread before clearing the global object as the thread is profiling itself rmtDelete(rmtThread, rmt->thread); + rmtDelete(ThreadProfilers, rmt->threadProfilers); + if (g_RemoteryCreated) { g_Remotery = NULL; @@ -7058,8 +7060,6 @@ static void Remotery_Destructor(Remotery* rmt) rmtDelete(ObjectAllocator, rmt->propertyAllocator); - rmtDelete(ThreadProfilers, rmt->threadProfilers); - #if RMT_USE_D3D12 while (rmt->d3d12Binds != NULL) {