diff --git a/src/lib/platform/COSXEventQueueBuffer.cpp b/src/lib/platform/COSXEventQueueBuffer.cpp index d6c26117..ce79fded 100644 --- a/src/lib/platform/COSXEventQueueBuffer.cpp +++ b/src/lib/platform/COSXEventQueueBuffer.cpp @@ -31,7 +31,9 @@ class CEventQueueTimer { }; // COSXEventQueueBuffer::COSXEventQueueBuffer(IEventQueue* events) : - m_eventQueue(events), m_event(NULL) + m_eventQueue(events), + m_event(NULL), + m_threadEventQueueRef(NULL) { // do nothing } @@ -98,7 +100,7 @@ COSXEventQueueBuffer::addEvent(UInt32 dataID) kEventAttributeNone, &event); - if (error == noErr) { + if (error == noErr & m_threadEventQueueRef != NULL) { error = PostEventToQueue(m_threadEventQueueRef, event, kEventPriorityStandard); ReleaseEvent(event);