]> git.saurik.com Git - wxWidgets.git/commitdiff
wxTLW: don't assert when setting null icons initially (#10138)
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 31 Oct 2008 10:06:19 +0000 (10:06 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 31 Oct 2008 10:06:19 +0000 (10:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/toplevel.cpp

index ec54792ae3c4805dfb531f82a71e42a3e025da9e..c0657b18bfd603af4e330b280b8cafff8af0985b 100644 (file)
@@ -993,6 +993,14 @@ void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons)
 {
     wxTopLevelWindowBase::SetIcons(icons);
 
+    if ( icons.IsEmpty() )
+    {
+        // FIXME: SetIcons(wxNullIconBundle) should unset existing icons,
+        //        but we currently don't do that
+        wxASSERT_MSG( m_icons.IsEmpty(), "unsetting icons doesn't work" );
+        return;
+    }
+
     if ( !DoSelectAndSetIcon(icons, SM_CXSMICON, SM_CYSMICON, ICON_SMALL) &&
             !DoSelectAndSetIcon(icons, SM_CXICON, SM_CYICON, ICON_BIG) )
     {