diff --git a/contrib/src/xrc/xmlres.cpp b/contrib/src/xrc/xmlres.cpp index 21375aff60..0a1b72cd3a 100644 --- a/contrib/src/xrc/xmlres.cpp +++ b/contrib/src/xrc/xmlres.cpp @@ -171,10 +171,7 @@ wxToolBar *wxXmlResource::LoadToolBar(wxWindow *parent, const wxString& name) wxDialog *wxXmlResource::LoadDialog(wxWindow *parent, const wxString& name) { - wxDialog *dialog = new wxDialog; - if (!LoadDialog(dialog, parent, name)) - { delete dialog; return NULL; } - else return dialog; + return (wxDialog*)CreateResFromNode(FindResource(name, wxT("wxDialog")), parent, NULL); } bool wxXmlResource::LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name) diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 21375aff60..0a1b72cd3a 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -171,10 +171,7 @@ wxToolBar *wxXmlResource::LoadToolBar(wxWindow *parent, const wxString& name) wxDialog *wxXmlResource::LoadDialog(wxWindow *parent, const wxString& name) { - wxDialog *dialog = new wxDialog; - if (!LoadDialog(dialog, parent, name)) - { delete dialog; return NULL; } - else return dialog; + return (wxDialog*)CreateResFromNode(FindResource(name, wxT("wxDialog")), parent, NULL); } bool wxXmlResource::LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name)