aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl
diff options
context:
space:
mode:
authorNadia Holmquist Pedersen <nadia@nhp.sh>2023-12-08 17:39:56 +0100
committerNadia Holmquist Pedersen <nadia@nhp.sh>2023-12-08 17:39:56 +0100
commit5ef35a4ccfc2d39dd62ca5901b435f4bcf149e7b (patch)
treeae3562920e73f21cccd151af9dd6a5838e973f4f /src/frontend/qt_sdl
parent890a66c0eb245d77e168ef2b45b9adb90815d487 (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.cpp11
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();