]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed crash in case of not subclasses wxWizardPage in the resources (coverity checker...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:34:34 +0000 (23:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:34:34 +0000 (23:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/xrc/xh_wizrd.cpp

index 9016e921d87976d80cc2529467022e9dd87f1edd..fd49ef89f75b0ad4f9e723c97d74ea905c5dc2ff 100644 (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());