git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43893
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void MacSetCurrentEvent( WXEVENTREF event , WXEVENTHANDLERCALLREF handler )
{ m_macCurrentEvent = event ; m_macCurrentEventHandlerCallRef = handler ; }
void MacSetCurrentEvent( WXEVENTREF event , WXEVENTHANDLERCALLREF handler )
{ m_macCurrentEvent = event ; m_macCurrentEventHandlerCallRef = handler ; }
+ // adding a CFType object to be released only at the end of the current event cycle (increases the
+ // refcount of the object passed), needed in case we are in the middle of an event concering an object
+ // we want to delete and cannot do it immediately
+ void MacAddToAutorelease( void* cfrefobj );
public:
static wxWindow* s_captureWindow ;
static long s_lastModifiers ;
public:
static wxWindow* s_captureWindow ;
static long s_lastModifiers ;
// Override to process unhandled events as you please
}
// Override to process unhandled events as you please
}
+CFMutableArrayRef GetAutoReleaseArray()
+{
+ static CFMutableArrayRef array = 0;
+ if ( array == 0)
+ array= CFArrayCreateMutable(kCFAllocatorDefault,0,&kCFTypeArrayCallBacks);
+ return array;
+}
+
void wxApp::MacHandleOneEvent( WXEVENTREF evr )
{
EventTargetRef theTarget;
void wxApp::MacHandleOneEvent( WXEVENTREF evr )
{
EventTargetRef theTarget;
#if wxUSE_THREADS
wxMutexGuiLeaveOrEnter();
#endif // wxUSE_THREADS
#if wxUSE_THREADS
wxMutexGuiLeaveOrEnter();
#endif // wxUSE_THREADS
+
+ CFArrayRemoveAllValues( GetAutoReleaseArray() );
+}
+
+void wxApp::MacAddToAutorelease( void* cfrefobj )
+{
+ CFArrayAppendValue( GetAutoReleaseArray(), cfrefobj );
}
long wxMacTranslateKey(unsigned char key, unsigned char code)
}
long wxMacTranslateKey(unsigned char key, unsigned char code)