Create an autorelease pool to catch objects created during several special situations, like customized initialization, so that we don't leak there.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1072,6 +1072,13 @@ wxApp::wxApp()
|
||||
m_macCurrentEvent = NULL ;
|
||||
m_macCurrentEventHandlerCallRef = NULL ;
|
||||
m_macEventPosted = NULL ;
|
||||
m_macPool = new wxMacAutoreleasePool();
|
||||
}
|
||||
|
||||
wxApp::~wxApp()
|
||||
{
|
||||
if (m_macPool)
|
||||
delete m_macPool;
|
||||
}
|
||||
|
||||
CFMutableArrayRef GetAutoReleaseArray()
|
||||
@@ -1087,6 +1094,13 @@ void wxApp::MacAddToAutorelease( void* 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
|
||||
|
Reference in New Issue
Block a user