aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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();