From: Stefan Csomor Date: Tue, 14 Apr 2009 19:54:01 +0000 (+0000) Subject: guaranteeing autorelease pools for overridden OnRun on OSX X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8b7b1a57483e51e325017dcbf35f75b578ae775c?hp=aeecbca0598300095af688d630c855eab4a36369 guaranteeing autorelease pools for overridden OnRun on OSX git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/tests/test.cpp b/tests/test.cpp index 667c2c0c30..2f7f71903c 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -41,6 +41,10 @@ #include "wx/msw/msvcrt.h" #endif +#ifdef __WXOSX__ + #include "wx/osx/private.h" +#endif + using namespace std; using CppUnit::Test; @@ -436,6 +440,13 @@ static Test *GetTestByName(const wxString& name) // int TestApp::OnRun() { +#if wxUSE_GUI +#ifdef __WXOSX__ + // make sure there's always an autorelease pool ready + wxMacAutoreleasePool autoreleasepool; +#endif +#endif + #if wxUSE_LOG // Switch off logging unless --verbose bool verbose = wxLog::GetVerbose();