]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/bitmap.cpp
fix for a crash in ~wxFontList
[wxWidgets.git] / src / mac / bitmap.cpp
index 2eddb0d5b96bd368fe307fcaec01d3fe43ca8ed7..65eb2eeb500ac4480a872373bf55d47512a7b749 100644 (file)
@@ -752,13 +752,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
 
 bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth)
 {
-               XImage *                ximage;
+       XImage *                ximage = NULL ;
+       XImage *                xshapeimage = NULL ;
        int                     ErrorStatus;
        XpmAttributes   xpmAttr;
 
     xpmAttr.valuemask = XpmReturnInfos; // get infos back
     ErrorStatus = XpmCreateImageFromData( GetMainDevice() , (char **)data,
-         &ximage, (XImage **) NULL, &xpmAttr);
+         &ximage, &xshapeimage, &xpmAttr);
 
     if (ErrorStatus == XpmSuccess)
     {
@@ -776,7 +777,12 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int widt
                        XImageFree(ximage); // releases the malloc, but does not detroy
                                  // the bitmap
                        M_BITMAPHANDLERDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
-               
+                       if ( xshapeimage != NULL )
+                       {
+                               wxMask* m = new wxMask() ;
+                               m->SetMaskBitmap( xshapeimage->gworldptr ) ;
+                               M_BITMAPHANDLERDATA->m_bitmapMask = m ;
+                       }
                        return TRUE;
     } 
     else