Avoid crash on startup when using single mode in docview sample.

The view doesn't have any associated frame when using the special "single
view" mode in the sample, so don't try to show it when creating a new view.

This resulted in a crash when starting the sample with --single command line
parameter.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2011-06-22 22:57:59 +00:00
parent 1aa727618e
commit c346d3d299

View File

@ -53,6 +53,7 @@ bool DrawingView::OnCreate(wxDocument *doc, long flags)
wxFrame* frame = app.CreateChildFrame(this, true);
wxASSERT(frame == GetFrame());
m_canvas = new MyCanvas(this);
frame->Show();
}
else // single document mode
{
@ -64,7 +65,6 @@ bool DrawingView::OnCreate(wxDocument *doc, long flags)
doc->GetCommandProcessor()->SetEditMenu(app.GetMainWindowEditMenu());
doc->GetCommandProcessor()->Initialize();
}
GetFrame()->Show();
return true;
}