]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/bitmap.cpp
Corrected a potential NULL pointer dereference in the SWIG runtime
[wxWidgets.git] / src / mac / carbon / bitmap.cpp
index 3a2d1991b775763583a2dcb3cc5a7f3063ce031e..8ae71b1ca0f151c72ab63186cbce6754b95221ab 100644 (file)
@@ -108,6 +108,10 @@ void wxMacReleaseBitmapButton( ControlButtonContentInfo*info )
     {
         ReleaseIconRef( info->u.iconRef ) ;
     }
+    else if ( info->contentType == kControlNoContent )
+    {
+        // there's no bitmap at all, fall through silently
+    }
     else if ( info->contentType == kControlContentPictHandle )
     {
         // owned by the bitmap, no release here
@@ -363,9 +367,6 @@ IconRef wxBitmapRefData::GetIconRef()
         }
         else
         {
-            iconFamily = (IconFamilyHandle) NewHandle(8) ;
-            (**iconFamily).resourceType = kIconFamilyType ;
-            (**iconFamily).resourceSize = sizeof(OSType) + sizeof(Size);
             PicHandle pic = GetPictHandle() ;
             SetIconFamilyData( iconFamily, 'PICT' , (Handle) pic ) ;
         }