X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5128e3be6818bfce55a585955e158e88961ba0f8..77fac225bac7384d9cb9abfb48f052533894194d:/src/common/appcmn.cpp?ds=inline diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 59e2ef34c6..6795eec0c4 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -40,6 +40,8 @@ #include "wx/cmdline.h" #include "wx/thread.h" #include "wx/confbase.h" +#include "wx/tokenzr.h" +#include "wx/utils.h" #if !defined(__WXMSW__) || defined(__WXMICROWIN__) #include // for SIGTRAP used by wxTrap() @@ -61,6 +63,19 @@ // initialization and termination // ---------------------------------------------------------------------------- +#ifdef __WXDEBUG__ +static void LINKAGEMODE SetTraceMasks() +{ + wxString mask; + if ( wxGetEnv(wxT("WXTRACE"), &mask) ) + { + wxStringTokenizer tkn(mask, wxT(",")); + while ( tkn.HasMoreTokens() ) + wxLog::AddTraceMask(tkn.GetNextToken()); + } +} +#endif + wxAppBase::wxAppBase() { wxTheApp = (wxApp *)this; @@ -74,6 +89,15 @@ wxAppBase::wxAppBase() m_exitOnFrameDelete = TRUE; m_isActive = TRUE; #endif // wxUSE_GUI + +#ifdef __WXDEBUG__ + SetTraceMasks(); +#endif +} + +wxAppBase::~wxAppBase() +{ + // this destructor is required for Darwin } #if wxUSE_GUI