Add a check for wxWindow::Create() success to wxXRC.

Give an error in a very unlikely but still possible case that the window
creation failed before setting it up.
This commit is contained in:
Vadim Zeitlin 2015-05-16 16:01:52 +02:00
parent 1c63ec5564
commit 12f69f7603

View File

@ -2433,6 +2433,16 @@ wxFont wxXmlResourceHandlerImpl::GetFont(const wxString& param, wxWindow* parent
void wxXmlResourceHandlerImpl::SetupWindow(wxWindow *wnd)
{
// This is called immediately after creating a window, so it's a convenient
// place to check that it was created successfully without duplicating this
// check in all handlers.
if ( !wnd->GetHandle() )
{
wxLogError(_("Creating %s \"%s\" failed."),
m_handler->m_class, GetName());
return;
}
//FIXME : add cursor
const wxString variant = GetParamValue(wxS("variant"));