From: Stefan Csomor Date: Mon, 21 Feb 2005 13:53:22 +0000 (+0000) Subject: adapting to bitmaprefdata changes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/796a6ef04aea22ee72425317b8b9a249d8ca292b adapting to bitmaprefdata changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/dataobj.cpp b/src/mac/carbon/dataobj.cpp index ae340be2c5..65401b5f33 100644 --- a/src/mac/carbon/dataobj.cpp +++ b/src/mac/carbon/dataobj.cpp @@ -254,8 +254,8 @@ wxBitmapDataObject::wxBitmapDataObject( Init(); if ( m_bitmap.Ok() ) { - m_pictHandle = wxMacCreatePicHandle( rBitmap ) ; - m_pictCreated = true ; + m_pictHandle = m_bitmap.GetBitmapData()->GetPictHandle() ; + m_pictCreated = false ; } } @@ -272,8 +272,8 @@ void wxBitmapDataObject::SetBitmap( wxBitmapDataObjectBase::SetBitmap(rBitmap); if ( m_bitmap.Ok() ) { - m_pictHandle = wxMacCreatePicHandle( rBitmap ) ; - m_pictCreated = true ; + m_pictHandle = m_bitmap.GetBitmapData()->GetPictHandle() ; + m_pictCreated = false ; } } diff --git a/src/mac/carbon/icon.cpp b/src/mac/carbon/icon.cpp index 27cc3149d2..2317c911e5 100644 --- a/src/mac/carbon/icon.cpp +++ b/src/mac/carbon/icon.cpp @@ -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() ) ; }