mwxLog was leaked - fixed
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Feb 2000 00:20:45 +0000 (00:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Feb 2000 00:20:45 +0000 (00:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/newgrid/griddemo.cpp
samples/newgrid/griddemo.h

index f6f12b7c7ba3d657404273e1ee15bd8481c245a5..b936e76b784a2c2b048cf2f845723bb3b2f3a121 100644 (file)
@@ -184,7 +184,7 @@ GridFrame::GridFrame()
                              wxTE_MULTILINE );
 
     logger = new wxLogTextCtrl( logWin );
-    logger->SetActiveTarget( logger );
+    m_logOld = logger->SetActiveTarget( logger );
     logger->SetTimestamp( NULL );
 
     // this will create a grid and, by default, an associated grid
@@ -253,6 +253,7 @@ GridFrame::GridFrame()
 
 GridFrame::~GridFrame()
 {
+    delete wxLog::SetActiveTarget(m_logOld);
 }
 
 
index 5d48a2c58c21e6e93c9de38bf179a6f7feab49e9..2bc68c20823fe3345221129ac0d0dd99c17e6619 100644 (file)
@@ -108,6 +108,8 @@ public:
         ID_TESTFUNC
     };
 
+    wxLog *m_logOld;
+
     DECLARE_EVENT_TABLE()
 };