From 95ece5ac2cc2aaaa0da63dd11d05902a42bde08f Mon Sep 17 00:00:00 2001 From: jerry Date: Wed, 25 Sep 2013 10:44:09 +0000 Subject: [PATCH] fixed Mac server keeps crashing during launch --- src/lib/platform/COSXEventQueueBuffer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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);