diff --git a/include/wx/app.h b/include/wx/app.h index 42b1425d26..c541b9015a 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -97,6 +97,9 @@ public: // class version! virtual bool Initialize(int& argc, wxChar **argv); + // This gives wxCocoa a chance to call OnInit() with a memory pool in place + virtual bool CallOnInit() { return OnInit(); } + // Called before OnRun(), this is a good place to do initialization -- if // anything fails, return false from here to prevent the program from // continuing. The command line is normally parsed here, call the base diff --git a/src/common/init.cpp b/src/common/init.cpp index 58e2b591a2..4db4aab90d 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -392,7 +392,7 @@ int wxEntryReal(int& argc, wxChar **argv) WX_SUPPRESS_UNUSED_WARN(cleanupOnExit); // app initialization - if ( !wxTheApp->OnInit() ) + if ( !wxTheApp->CallOnInit() ) { // don't call OnExit() if OnInit() failed return -1;