X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/92e898b0b47f5b881453bf75778c5f8f08b38c89..7e48d7d9fb4b546e6a68239e8a77ce7ef79df3b0:/src/xrc/xmlres.cpp?ds=sidebyside 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)