+ // wxApp initialization: this can be customized
+ // --------------------------------------------
+
+ if ( !app->Initialize(argc, argv) )
+ return false;
+
+ // remember, possibly modified (e.g. due to removal of toolkit-specific
+ // parameters), command line arguments in member variables
+ app->argc = argc;
+ app->argv = argv;
+
+ wxCallAppCleanup callAppCleanup(app.get());
+
+
+ // common initialization after wxTheApp creation
+ // ---------------------------------------------
+
+ if ( !DoCommonPostInit() )
+ return false;
+
+
+ // prevent the smart pointer from destroying its contents
+ app.release();
+
+ // and the cleanup object from doing cleanup
+ callAppCleanup.Dismiss();
+
+#if wxUSE_LOG
+ // now that we have a valid wxApp (wxLogGui would have crashed if we used
+ // it before now), we can delete the temporary sink we had created for the
+ // initialization messages -- the next time logging function is called, the
+ // sink will be recreated but this time wxAppTraits will be used
+ delete wxLog::SetActiveTarget(NULL);
+#endif // wxUSE_LOG
+
+ return true;