]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
It was not acceptable to call the class method from the static initializer
[wxWidgets.git] / 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_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; 
  
-        // stop all processing 
         m_table=0; 
         m_selection=0; 
-        m_created = FALSE; 
         m_numRows=0; 
         m_numCols=0; 
     }