Skip to content

Commit 2454554

Browse files
Cleaned up the cleanup process.
1 parent 9b9bb15 commit 2454554

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/Worksheet.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,14 +327,11 @@ Worksheet::~Worksheet()
327327

328328
m_mainToolBar = NULL;
329329

330-
if (m_tree != NULL)
331-
DestroyTree();
332-
m_tree = NULL;
333-
330+
ClearDocument();
331+
334332
wxDELETE(m_configuration);
335-
wxDELETE(m_dc);
336-
m_dc = NULL;
337333
m_configuration = NULL;
334+
m_dc = NULL;
338335
}
339336

340337
/***

src/wxMaximaFrame.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,13 @@ wxMaximaFrame::~wxMaximaFrame()
257257
// We cannot call delete here as we don't know if there are still timer-
258258
// or similar events pending for the wxWindows we want to free the memory
259259
// for.
260-
m_history->Destroy();
261-
m_worksheet->m_tableOfContents->Destroy();
262-
m_worksheet->m_tableOfContents = NULL;
263-
m_worksheet->Destroy();
260+
//
261+
// And as their parent is destroyed all objects in the frame will
262+
// automatically be destroyed, anyway.
263+
// m_history->Destroy();
264+
// m_worksheet->m_tableOfContents->Destroy();
265+
// m_worksheet->m_tableOfContents = NULL;
266+
// m_worksheet->Destroy();
264267
}
265268

266269
void wxMaximaFrame::set_properties()

0 commit comments

Comments
 (0)