From 7fbc89bb02d09a525e8ae537b44c6e1e1d7cb41d Mon Sep 17 00:00:00 2001 From: David Elliott Date: Thu, 3 Jul 2003 15:32:11 +0000 Subject: [PATCH] Added CallOnInit() which allows the toolkit (wxCocoa) to do a bit of processing around the real OnInit() call. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/app.h | 3 +++ src/common/init.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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; -- 2.45.2