git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62557
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
class WXDLLIMPEXP_FWD_CORE wxApp ;
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
class WXDLLIMPEXP_FWD_BASE wxLog;
class WXDLLIMPEXP_FWD_CORE wxApp ;
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
class WXDLLIMPEXP_FWD_BASE wxLog;
+class WXDLLIMPEXP_FWD_CORE wxMacAutoreleasePool;
// Force an exit from main loop
void WXDLLIMPEXP_CORE wxExit();
// Force an exit from main loop
void WXDLLIMPEXP_CORE wxExit();
DECLARE_DYNAMIC_CLASS(wxApp)
wxApp();
DECLARE_DYNAMIC_CLASS(wxApp)
wxApp();
virtual void WakeUpIdle();
virtual void WakeUpIdle();
protected:
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
protected:
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
+ wxMacAutoreleasePool* m_macPool;
// we want to delete and cannot do it immediately
// TODO change semantics to be in line with cocoa (make autrelease NOT increase the count)
void MacAddToAutorelease( void* cfrefobj );
// we want to delete and cannot do it immediately
// TODO change semantics to be in line with cocoa (make autrelease NOT increase the count)
void MacAddToAutorelease( void* cfrefobj );
+ void MacReleaseAutoreleasePool();
public:
static wxWindow* s_captureWindow ;
static long s_lastModifiers ;
public:
static wxWindow* s_captureWindow ;
static long s_lastModifiers ;
m_macCurrentEvent = NULL ;
m_macCurrentEventHandlerCallRef = NULL ;
m_macEventPosted = NULL ;
m_macCurrentEvent = NULL ;
m_macCurrentEventHandlerCallRef = NULL ;
m_macEventPosted = NULL ;
+ m_macPool = new wxMacAutoreleasePool();
+}
+
+wxApp::~wxApp()
+{
+ if (m_macPool)
+ delete m_macPool;
}
CFMutableArrayRef GetAutoReleaseArray()
}
CFMutableArrayRef GetAutoReleaseArray()
CFArrayAppendValue( GetAutoReleaseArray(), cfrefobj );
}
CFArrayAppendValue( GetAutoReleaseArray(), cfrefobj );
}
+void wxApp::MacReleaseAutoreleasePool()
+{
+ if (m_macPool)
+ delete m_macPool;
+ m_macPool = new wxMacAutoreleasePool();
+}
+
void wxApp::OnIdle(wxIdleEvent& WXUNUSED(event))
{
// If they are pending events, we must process them: pending events are
void wxApp::OnIdle(wxIdleEvent& WXUNUSED(event))
{
// If they are pending events, we must process them: pending events are