fixed crash in case of not subclasses wxWizardPage in the resources (coverity checker CID 18)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2006-03-07 23:34:34 +00:00
parent 32592f4a80
commit 37b6a42697

View File

@ -55,8 +55,7 @@ wxObject *wxWizardXmlHandler::DoCreateResource()
}
else
{
wxWizardPage *page = NULL;
wxUnusedVar(page);
wxWizardPage *page;
if (m_class == wxT("wxWizardPageSimple"))
{
@ -69,13 +68,14 @@ wxObject *wxWizardXmlHandler::DoCreateResource()
}
else /*if (m_class == wxT("wxWizardPage"))*/
{
wxWizardPage *p = NULL;
if (m_instance)
p = wxStaticCast(m_instance, wxWizardPage);
else
if ( !m_instance )
{
wxLogError(wxT("wxWizardPage is abstract class, must be subclassed"));
p->Create(m_wizard, GetBitmap());
page = p;
return NULL;
}
page = wxStaticCast(m_instance, wxWizardPage);
page->Create(m_wizard, GetBitmap());
}
page->SetName(GetName());