]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xh_mdi.cpp
fix another memory leak in SetCommand() (coverity checker CID 52)
[wxWidgets.git] / src / xrc / xh_mdi.cpp
index ef69b476a2d69806d526ba4f57652811e106e15c..5838d7c28814ea79d3928a2d7756daf09e4c1659 100644 (file)
@@ -8,10 +8,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "xh_mdi.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -105,10 +101,11 @@ wxObject *wxMdiXmlHandler::DoCreateResource()
         frame->SetClientSize(GetSize());
     if (HasParam(wxT("pos")))
         frame->Move(GetPosition());
-    if (HasParam(wxT("icon")) && frame->IsKindOf(CLASSINFO(wxFrame)))
+    if (HasParam(wxT("icon")))
     {
-        wxFrame* f = wxDynamicCast(f, wxFrame);
-        f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
+        wxFrame* f = wxDynamicCast(frame, wxFrame);
+        if (f)
+            f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON));
     }
 
     SetupWindow(frame);