]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied Patch 760644 (wxGrid SetTable uses deleted wxGridTable).
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 29 Jun 2003 15:18:46 +0000 (15:18 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 29 Jun 2003 15:18:46 +0000 (15:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 45562e16be4ebb0058a563a9c7a8b5635ba4d314..001bdbd65eb6fd6c42d08293816b90099d902d01 100644 (file)
@@ -3913,14 +3913,19 @@ bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership,
 {
     if ( m_created )
     {
 {
     if ( m_created )
     {
-        if (m_ownTable) 
-            delete m_table; 
+        // stop all processing 
+        m_created = FALSE; 
+
+        if (m_ownTable)
+        {
+            wxGridTableBase *t=m_table;
+            m_table=0;
+            delete t; 
+        }
         delete m_selection; 
  
         delete m_selection; 
  
-        // stop all processing 
         m_table=0; 
         m_selection=0; 
         m_table=0; 
         m_selection=0; 
-        m_created = FALSE; 
         m_numRows=0; 
         m_numCols=0; 
     }
         m_numRows=0; 
         m_numCols=0; 
     }