Applied patch [ 1171467 ] Fix for DocManager not checking OnNewDocument's return value
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
6489e7ee02
commit
f5729a6bca
@ -1225,7 +1225,12 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
|
||||
{
|
||||
newDoc->SetDocumentName(temp->GetDocumentName());
|
||||
newDoc->SetDocumentTemplate(temp);
|
||||
newDoc->OnNewDocument();
|
||||
if (!newDoc->OnNewDocument() )
|
||||
{
|
||||
// Document is implicitly deleted by DeleteAllViews
|
||||
newDoc->DeleteAllViews();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return newDoc;
|
||||
}
|
||||
@ -1248,7 +1253,12 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags)
|
||||
{
|
||||
newDoc->SetDocumentName(temp->GetDocumentName());
|
||||
newDoc->SetDocumentTemplate(temp);
|
||||
newDoc->OnNewDocument();
|
||||
if (!newDoc->OnNewDocument() )
|
||||
{
|
||||
// Document is implicitly deleted by DeleteAllViews
|
||||
newDoc->DeleteAllViews();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return newDoc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user