X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ee6b1d97e741fda8d579fa21cbc89f0c91615cef..f1f6d4659ca0581c6dcf3bfbbe9265a42627bbe7:/src/mac/macnotfy.cpp diff --git a/src/mac/macnotfy.cpp b/src/mac/macnotfy.cpp index 3546eeb7f2..9d0a2a8346 100644 --- a/src/mac/macnotfy.cpp +++ b/src/mac/macnotfy.cpp @@ -7,6 +7,10 @@ * ------------------------------------------------------------------------- */ +#include "wx/wx.h" + +#include "wx/mac/private.h" + #include "wx/mac/macnotfy.h" const short kMaxEvents = 1000 ; @@ -24,7 +28,7 @@ struct wxMacNotificationEvents typedef struct wxMacNotificationEvents wxMacNotificationEvents ; wxMacNotificationEvents gMacNotificationEvents ; -ProcessSerialNumber gSocketProcess ; +ProcessSerialNumber gAppProcess ; void wxMacWakeUp() { @@ -32,20 +36,20 @@ void wxMacWakeUp() Boolean isSame ; psn.highLongOfPSN = 0 ; psn.lowLongOfPSN = kCurrentProcess ; - SameProcess( &gSocketProcess , &psn , &isSame ) ; + SameProcess( &gAppProcess , &psn , &isSame ) ; if ( isSame ) { PostEvent( nullEvent , 0 ) ; } else { - WakeUpProcess( &gSocketProcess ) ; + WakeUpProcess( &gAppProcess ) ; } } void wxMacCreateNotifierTable() { - GetCurrentProcess(&gSocketProcess); + GetCurrentProcess(&gAppProcess); gMacNotificationEvents.top = 0 ; gMacNotificationEvents.bottom = 0 ; for ( int i = 0 ; i < kMaxEvents ; ++i ) @@ -58,7 +62,6 @@ void wxMacCreateNotifierTable() void wxMacDestroyNotifierTable() { - wxASSERT( gMacNotificationEvents.top == gMacNotificationEvents.bottom ) ; } wxMacNotifierTableRef wxMacGetNotifierTable() @@ -74,6 +77,7 @@ void wxMacAddEvent( short wakeUp ) { wxMacNotificationEvents *e = (wxMacNotificationEvents *) table ; + wxASSERT_MSG( handler != NULL , "illegal notification proc ptr" ) ; /* this should be protected eventually */ short index = e->top++ ; @@ -125,7 +129,8 @@ void wxMacProcessNotifierEvents() gMacNotificationEvents.events[index] = NULL ; gMacNotificationEvents.proc[index] = NULL ; - handler( event , data ) ; + if ( handler ) + handler( event , data ) ; } gInProcessing = false ; }