Skip to content

Commit

Permalink
Don't try to poke at the header on deinit if MPQueue is nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiaholmquist committed Dec 8, 2023
1 parent 890a66c commit 5ef35a4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/frontend/qt_sdl/LocalMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,13 @@ void DeInit()
if (MPQueue)
{
MPQueue->lock();
MPQueueHeader* header = (MPQueueHeader*)MPQueue->data();
header->ConnectedBitmask &= ~(1 << InstanceID);
header->InstanceBitmask &= ~(1 << InstanceID);
header->NumInstances--;
if (MPQueue->data() != nullptr)
{
MPQueueHeader *header = (MPQueueHeader *) MPQueue->data();
header->ConnectedBitmask &= ~(1 << InstanceID);
header->InstanceBitmask &= ~(1 << InstanceID);
header->NumInstances--;
}
MPQueue->unlock();

SemPoolDeinit();
Expand Down

0 comments on commit 5ef35a4

Please sign in to comment.