]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
patch 1352744
[wxWidgets.git] / src / common / appbase.cpp
index c0af2ac2564d6427b09314cf8aef2401184eaf22..663e7ea67063d7c5064f7bc9ffe2fa7003b7f974 100644 (file)
 #endif
 
 #if defined(__WXMAC__)
-    // VZ: MacTypes.h is enough under Mac OS X (where I could test it) but
-    //     I don't know which headers are needed under earlier systems so
-    //     include everything when in doubt
     #ifdef __DARWIN__
-        #include  "MacTypes.h"
+        #include  <CoreServices/CoreServices.h>
     #else
         #include  "wx/mac/private.h"  // includes mac headers
     #endif
@@ -147,11 +144,11 @@ wxAppConsole::~wxAppConsole()
 // initilization/cleanup
 // ----------------------------------------------------------------------------
 
-bool wxAppConsole::Initialize(int& argc, wxChar **argv)
+bool wxAppConsole::Initialize(int& argcOrig, wxChar **argvOrig)
 {
     // remember the command line arguments
-    this->argc = argc;
-    this->argv = argv;
+    argc = argcOrig;
+    argv = argvOrig;
 
 #ifndef __WXPALMOS__
     if ( m_appName.empty() && argv )
@@ -210,10 +207,6 @@ int wxAppConsole::OnExit()
     delete wxConfigBase::Set((wxConfigBase *) NULL);
 #endif // wxUSE_CONFIG
 
-    // use Set(NULL) and not Get() to avoid creating a message output object on
-    // demand when we just want to delete it
-    delete wxMessageOutput::Set(NULL);
-
     return 0;
 }
 
@@ -714,12 +707,6 @@ static wxString GetAssertStackTrace()
 {
     wxString stackTrace;
 
-#if wxUSE_DBGHELP
-    // check that we can get the stack trace before trying to do it
-    if ( !wxDbgHelpDLL::Init() )
-        return stackTrace;
-#endif
-    
     class StackDump : public wxStackWalker
     {
     public:
@@ -730,7 +717,11 @@ static wxString GetAssertStackTrace()
     protected:
         virtual void OnStackFrame(const wxStackFrame& frame)
         {
-            m_stackTrace << wxString::Format(_T("[%02d] "), frame.GetLevel());
+            m_stackTrace << wxString::Format
+                            (
+                              _T("[%02d] "),
+                              wx_truncate_cast(int, frame.GetLevel())
+                            );
 
             wxString name = frame.GetName();
             if ( !name.empty() )
@@ -739,11 +730,7 @@ static wxString GetAssertStackTrace()
             }
             else
             {
-                m_stackTrace << wxString::Format
-                                (
-                                    _T("0x%08lx"),
-                                    (unsigned long)frame.GetAddress()
-                                );
+                m_stackTrace << wxString::Format(_T("%p"), frame.GetAddress());
             }
 
             if ( frame.HasSourceLocation() )