From 89fb9e528fefc90fc376f5980ff1007e6ecfd811 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Dec 2009 17:03:25 +0000 Subject: [PATCH] Reset wxTheApp when starting to destroy the object it points to. Using wxTheApp when the corresponding object is already half destroyed can't be a good idea so reset it to NULL as soon as possible. Closes #11525. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62813 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/appbase.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index c8ec12a388..f2bed9aca8 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -154,6 +154,10 @@ wxAppConsoleBase::wxAppConsoleBase() wxAppConsoleBase::~wxAppConsoleBase() { + // we're being destroyed and using this object from now on may not work or + // even crash so don't leave dangling pointers to it + ms_appInstance = NULL; + delete m_traits; } -- 2.45.2