#include "unistd.h"
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
#include "../gdk_imlib/gdk_imlib.h"
#endif
{
/*
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
(void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
#endif
*/
wxInitializeResourceSystem();
// For PostScript printing
-#if USE_POSTSCRIPT
+#if wxUSE_POSTSCRIPT
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
wxCleanUpResourceSystem();
wxSystemSettings::Done();
-
- wxClassInfo::CleanUpClasses();
}
wxLog *wxApp::CreateLogTarget()
wxClassInfo::InitializeClasses();
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
-#if !defined(_WINDLL)
streambuf* sBuf = new wxDebugStreamBuf;
-#else
- streambuf* sBuf = NULL;
-#endif
ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf);
wxTheApp->argc = argc;
wxTheApp->argv = argv;
+ char name[200];
+ strcpy( name, argv[0] );
+ strcpy( name, wxFileNameFromPath(name) );
+ wxStripExtension( name );
+ wxTheApp->SetAppName( name );
+
gtk_set_locale();
gtk_init( &argc, &argv );
-#ifdef USE_GDK_IMLIB
+#ifdef wxUSE_GDK_IMLIB
gdk_imlib_init();
wxDELETE(wxTheApp);
-#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
- // At this point we want to check if there are any memory
- // blocks that aren't part of the wxDebugContext itself,
- // as a special case. Then when dumping we need to ignore
- // wxDebugContext, too.
+ wxLog *oldLog = wxLog::SetActiveTarget( NULL );
+ if (oldLog) delete oldLog;
+
+ wxClassInfo::CleanUpClasses();
+
+ delete[] wxBuffer;
+
+#if (WXDEBUG && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxTrace("There were memory leaks.\n");
wxDebugContext::PrintStatistics();
}
wxDebugContext::SetStream(NULL, NULL);
+
#endif
return retValue;