]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/poem/wxpoem.cpp
reset preview bitmap variable to NULL after deleting it
[wxWidgets.git] / demos / poem / wxpoem.cpp
index 2a2d89c03166c89552208c26e779dd7e2b505147..3a12a83581f90747e9e9d428d4587792a0d0c206 100644 (file)
@@ -683,7 +683,9 @@ int MyApp::OnExit()
   delete NormalFont;
   delete BoldFont;
   delete ItalicFont;
-  delete poem_buffer;
+  delete[] poem_buffer;
+  if (search_string)
+    delete[] search_string;
 
   return 0;
 }
@@ -993,7 +995,7 @@ long MainWindow::DoSearch(void)
 // Load index (or compile it if none found)
 void TryLoadIndex()
 {
-  index_ok = LoadIndex(index_filename);
+  index_ok = (LoadIndex(index_filename) != 0);
   if (!index_ok || (nitems == 0))
   {
       PoetryError("Index file not found; will compile new one", "wxPoem");