- if (!GetDocument()->Close())
- return FALSE;
-
- // Clear the canvas in case we're in single-window mode,
- // and the canvas stays.
- canvas->Clear();
- canvas->view = NULL;
- canvas = NULL;
-
- wxString s(wxTheApp->GetAppName());
- if (frame)
- frame->SetTitle(s);
-
- SetFrame(NULL);
-
- Activate(FALSE);
-
- if (deleteWindow && !singleWindowMode)
- {
- delete frame;
- return TRUE;
- }
- return TRUE;
+ if (!GetDocument()->Close())
+ return false;
+
+ // Clear the canvas in case we're in single-window mode,
+ // and the canvas stays.
+ canvas->ClearBackground();
+ canvas->view = (wxView *) NULL;
+ canvas = (MyCanvas *) NULL;
+
+ wxString s(wxTheApp->GetAppName());
+ if (frame)
+ frame->SetTitle(s);
+
+ SetFrame((wxFrame *) NULL);
+
+ Activate(false);
+
+ if (deleteWindow && !singleWindowMode)
+ {
+ delete frame;
+ return true;
+ }
+ return true;