projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compilation fixes for !USE_PCH
[wxWidgets.git]
/
src
/
common
/
init.cpp
diff --git
a/src/common/init.cpp
b/src/common/init.cpp
index 70c9dafcdbb824c857d9b9e59c330255aef42c4d..4f0aed6e49c55831e14f83e71621116449589d3e 100644
(file)
--- a/
src/common/init.cpp
+++ b/
src/common/init.cpp
@@
-27,6
+27,7
@@
#include "wx/app.h"
#include "wx/debug.h"
#include "wx/filefn.h"
#include "wx/app.h"
#include "wx/debug.h"
#include "wx/filefn.h"
+ #include "wx/log.h"
#endif
#include "wx/module.h"
#endif
#include "wx/module.h"
@@
-35,7
+36,7
@@
// global vars
// ----------------------------------------------------------------------------
// global vars
// ----------------------------------------------------------------------------
-
wxApp * WXDLLEXPORT
wxTheApp = NULL;
+
WXDLLEXPORT wxApp *
wxTheApp = NULL;
wxAppInitializerFunction
wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL;
wxAppInitializerFunction
wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL;
@@
-76,13
+77,6
@@
void WXDLLEXPORT wxExit()
abort();
}
abort();
}
-// Yield to other apps/messages
-bool WXDLLEXPORT wxYield()
-{
- // do nothing
- return TRUE;
-}
-
// Yield to other apps/messages
void WXDLLEXPORT wxWakeUpIdle()
{
// Yield to other apps/messages
void WXDLLEXPORT wxWakeUpIdle()
{
@@
-155,18
+149,16
@@
int wxEntry(int argc, char **argv)
#if wxUSE_UNICODE
wxTheApp->argv = new wxChar*[argc+1];
#if wxUSE_UNICODE
wxTheApp->argv = new wxChar*[argc+1];
- int mb_argc = 0;
- while (mb_argc < argc)
+ for ( int mb_argc = 0; mb_argc < argc; mb_argc++ )
{
{
- wxTheApp->argv[mb_argc] = wxStrdup(wxConvLibc.cMB2WX(argv[mb_argc]));
- mb_argc++;
+ wxTheApp->argv[mb_argc] = wxStrdup(wxConvLocal.cMB2WX(argv[mb_argc]));
}
wxTheApp->argv[mb_argc] = (wxChar *)NULL;
#else
wxTheApp->argv = argv;
#endif
}
wxTheApp->argv[mb_argc] = (wxChar *)NULL;
#else
wxTheApp->argv = argv;
#endif
- wxString name = wxFileNameFromPath(argv[0]);
+ wxString name = wxFileNameFromPath(
wxTheApp->
argv[0]);
wxStripExtension(name);
wxTheApp->SetAppName(name);
wxStripExtension(name);
wxTheApp->SetAppName(name);
@@
-227,6
+219,14
@@
static void DoCleanUp()
wxClassInfo::CleanUpClasses();
wxClassInfo::CleanUpClasses();
+ // TODO: this should really be done in ~wxApp
+#if wxUSE_UNICODE
+ for ( int mb_argc = 0; mb_argc < wxTheApp->argc; mb_argc++ )
+ {
+ free(wxTheApp->argv[mb_argc]);
+ }
+#endif // wxUSE_UNICODE
+
// delete the application object
delete wxTheApp;
wxTheApp = (wxApp *)NULL;
// delete the application object
delete wxTheApp;
wxTheApp = (wxApp *)NULL;
@@
-236,3
+236,4
@@
static void DoCleanUp()
delete wxLog::SetActiveTarget(NULL);
#endif // wxUSE_LOG
}
delete wxLog::SetActiveTarget(NULL);
#endif // wxUSE_LOG
}
+