r439: no message
[ctsim.git] / src / views.cpp
index 62a15395e2cba28502e528d6399d5cf111d821da..9d0314ac8b66e143b5fe169bd7f064a636aaedab 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.71 2001/01/26 05:37:24 kevin Exp $
+**  $Id: views.cpp,v 1.72 2001/01/26 09:54:31 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -996,9 +996,11 @@ ImageFileView::OnClose (bool deleteWindow)
   if (!GetDocument()->Close())
     return false;
   
-//  m_canvas->Clear();
-//  m_canvas->setView(NULL);
-  m_canvas = NULL;
+  if (m_canvas) {
+  //  m_canvas->Clear();
+    m_canvas->setView(NULL);
+    m_canvas = NULL;
+  }
   wxString s(theApp->GetAppName());
 //  if (m_frame)
 //    m_frame->SetTitle(s);
@@ -2023,9 +2025,11 @@ PhantomFileView::OnClose (bool deleteWindow)
   if (!GetDocument()->Close())
     return false;
   
-//  m_canvas->Clear();
-//  m_canvas->setView(NULL);
-  m_canvas = NULL;
+  if (m_canvas) {
+    m_canvas->Clear();
+    m_canvas->setView(NULL);
+    m_canvas = NULL;
+  }
   wxString s(wxTheApp->GetAppName());
   if (m_frame)
     m_frame->SetTitle(s);
@@ -2484,9 +2488,11 @@ ProjectionFileView::OnClose (bool deleteWindow)
   if (!GetDocument()->Close())
     return false;
   
-  //m_canvas->Clear();
-  //m_canvas->setView(NULL);
-  m_canvas = NULL;
+  if (m_canvas) {
+    //m_canvas->Clear();
+    m_canvas->setView(NULL);
+    m_canvas = NULL;
+  }
 //  wxString s(wxTheApp->GetAppName());
 //  if (m_frame)
 //    m_frame->SetTitle(s);
@@ -2810,9 +2816,11 @@ PlotFileView::OnClose (bool deleteWindow)
   if (!GetDocument()->Close())
     return false;
   
-  //m_canvas->Clear();
-  //m_canvas->setView (NULL);
-  m_canvas = NULL;
+  if (m_canvas) {
+    //m_canvas->Clear();
+    m_canvas->setView (NULL);
+    m_canvas = NULL;
+  }
 //  wxString s(wxTheApp->GetAppName());
 //  if (m_frame)
 //    m_frame->SetTitle(s);