]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/icon.cpp
adding peer back to wxWindow
[wxWidgets.git] / src / mac / carbon / icon.cpp
index 27cc3149d219eea3446930935f021dd99e32f747..2317c911e58f29dda7934f37e9b2aaec853ab780 100644 (file)
@@ -192,7 +192,10 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
 {
     UnRef() ;
     
-    m_refData = new wxIconRefData( (WXHICON) wxMacCreateIconRef( bmp ) ) ;
+    // as the bitmap owns that ref, we have to acquire it as well
+    IconRef iconRef = bmp.GetBitmapData()->GetIconRef() ;
+    AcquireIconRef( iconRef ) ;
+    m_refData = new wxIconRefData( (WXHICON) iconRef ) ;
     M_ICONDATA->SetWidth( bmp.GetWidth() ) ;
     M_ICONDATA->SetHeight( bmp.GetHeight() ) ;
 }