Skip to content

Commit

Permalink
Changed the order some things are destroyed. This fixes the crash at …
Browse files Browse the repository at this point in the history
…shutdown when shutting down right after initialization.
  • Loading branch information
ruifig committed Dec 12, 2023
1 parent 4e65390 commit 7b22558
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Remotery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand Down

0 comments on commit 7b22558

Please sign in to comment.