diff options
author | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2023-12-08 17:39:56 +0100 |
---|---|---|
committer | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2023-12-08 17:39:56 +0100 |
commit | 5ef35a4ccfc2d39dd62ca5901b435f4bcf149e7b (patch) | |
tree | ae3562920e73f21cccd151af9dd6a5838e973f4f /src/frontend/qt_sdl | |
parent | 890a66c0eb245d77e168ef2b45b9adb90815d487 (diff) |
Don't try to poke at the header on deinit if MPQueue is nullptr
Diffstat (limited to 'src/frontend/qt_sdl')
-rw-r--r-- | src/frontend/qt_sdl/LocalMP.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/frontend/qt_sdl/LocalMP.cpp b/src/frontend/qt_sdl/LocalMP.cpp index a0dfdf7..c69537a 100644 --- a/src/frontend/qt_sdl/LocalMP.cpp +++ b/src/frontend/qt_sdl/LocalMP.cpp @@ -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(); |