Don't try to poke at the header on deinit if MPQueue is nullptr

This commit is contained in:
Nadia Holmquist Pedersen 2023-12-08 17:39:56 +01:00
parent 890a66c0eb
commit 5ef35a4ccf
1 changed files with 7 additions and 4 deletions

View File

@ -303,10 +303,13 @@ void DeInit()
if (MPQueue) if (MPQueue)
{ {
MPQueue->lock(); MPQueue->lock();
MPQueueHeader* header = (MPQueueHeader*)MPQueue->data(); if (MPQueue->data() != nullptr)
header->ConnectedBitmask &= ~(1 << InstanceID); {
header->InstanceBitmask &= ~(1 << InstanceID); MPQueueHeader *header = (MPQueueHeader *) MPQueue->data();
header->NumInstances--; header->ConnectedBitmask &= ~(1 << InstanceID);
header->InstanceBitmask &= ~(1 << InstanceID);
header->NumInstances--;
}
MPQueue->unlock(); MPQueue->unlock();
SemPoolDeinit(); SemPoolDeinit();