X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07a9af327e1ce49afe9528ab761f98123387d853..a81c3c2383f9096ef5e96b708a0f1c1ffe7cc6a8:/samples/treelay/treelay.cpp?ds=sidebyside diff --git a/samples/treelay/treelay.cpp b/samples/treelay/treelay.cpp index 02e00da18c..41d2671a9c 100644 --- a/samples/treelay/treelay.cpp +++ b/samples/treelay/treelay.cpp @@ -24,7 +24,7 @@ #include "treelay.h" -wxTreeLayoutStored *myTree = NULL; +wxTreeLayoutStored *myTree = (wxTreeLayoutStored *) NULL; // A macro needed for some compilers (AIX) that need 'main' to be defined // in the application itself. @@ -85,6 +85,17 @@ bool MyApp::OnInit() return TRUE; } +int MyApp::OnExit() +{ + if (myTree) + { + delete myTree; + myTree = (wxTreeLayoutStored *) NULL; + } + + return 0; +} + void MyApp::TreeTest(wxTreeLayoutStored& tree, wxDC& dc) { tree.Initialize(200);