X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5df4fc722412fe5f6764c490925b26293c5f662..2b9a7d4cc2f5f55df3d83f7cf2160cf9a509a4f2:/src/cocoa/icon.mm diff --git a/src/cocoa/icon.mm b/src/cocoa/icon.mm index 5299b5a645..889f03e7cd 100644 --- a/src/cocoa/icon.mm +++ b/src/cocoa/icon.mm @@ -6,7 +6,7 @@ // Created: 2003/08/11 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -15,6 +15,8 @@ #endif //WX_PRECOMP #include "wx/bitmap.h" +#include "wx/cocoa/autorelease.h" + #import // ======================================================================== @@ -64,6 +66,7 @@ wxIconRefData::wxIconRefData( const wxIconRefData& data) wxIconRefData::~wxIconRefData() { + wxAutoNSAutoreleasePool pool; [m_cocoaNSImage release]; m_cocoaNSImage = NULL; } @@ -122,7 +125,8 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bitmap) m_refData = new wxIconRefData; M_ICONDATA->m_width = bitmap.GetWidth(); M_ICONDATA->m_height = bitmap.GetHeight(); - M_ICONDATA->m_cocoaNSImage = bitmap.GetNSImage(true); + wxAutoNSAutoreleasePool pool; + M_ICONDATA->m_cocoaNSImage = [bitmap.GetNSImage(true) retain]; M_ICONDATA->m_ok = bitmap.Ok(); M_ICONDATA->m_numColors = 0; M_ICONDATA->m_quality = 0;