handle exceptions thrown from overridden wxView::OnCreate() gracefully
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57671 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -324,6 +324,7 @@ All:
|
||||
- Added wxArray::swap().
|
||||
- Added wxSHUTDOWN_LOGOFF and wxSHUTDOWN_FORCE wxShutdown() flags (troelsk).
|
||||
- Added wxSocket::ShutdownOutput().
|
||||
- Handle exceptions thrown from overridden wxView::OnCreate() gracefully.
|
||||
|
||||
All (Unix):
|
||||
|
||||
|
@@ -57,6 +57,7 @@
|
||||
#include "wx/tokenzr.h"
|
||||
#include "wx/filename.h"
|
||||
#include "wx/vector.h"
|
||||
#include "wx/ptr_scpd.h"
|
||||
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
#include "wx/ioswrap.h"
|
||||
@@ -779,20 +780,15 @@ wxDocTemplate::InitDocument(wxDocument* doc, const wxString& path, long flags)
|
||||
|
||||
wxView *wxDocTemplate::CreateView(wxDocument *doc, long flags)
|
||||
{
|
||||
wxView *view = DoCreateView();
|
||||
if ( view == NULL )
|
||||
wxScopedPtr<wxView> view(DoCreateView());
|
||||
if ( !view )
|
||||
return NULL;
|
||||
|
||||
view->SetDocument(doc);
|
||||
if (view->OnCreate(doc, flags))
|
||||
{
|
||||
return view;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete view;
|
||||
if ( !view->OnCreate(doc, flags) )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return view.release();
|
||||
}
|
||||
|
||||
// The default (very primitive) format detection: check is the extension is
|
||||
|
Reference in New Issue
Block a user