From 37b6a42697bcba2a23f1eeb826c58c53074ccb34 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Mar 2006 23:34:34 +0000 Subject: [PATCH] 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 --- src/xrc/xh_wizrd.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/xrc/xh_wizrd.cpp b/src/xrc/xh_wizrd.cpp index 9016e921d8..fd49ef89f7 100644 --- a/src/xrc/xh_wizrd.cpp +++ b/src/xrc/xh_wizrd.cpp @@ -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()); -- 2.47.2