wxIcon::CopyFromBitmap:
1. retain NSImage from bitmap.GetNSImage (since it is alloc/autoreleased) 2. Use a wxAutoNSAutoreleasePool git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -15,6 +15,8 @@
|
|||||||
#endif //WX_PRECOMP
|
#endif //WX_PRECOMP
|
||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
|
#include "wx/cocoa/autorelease.h"
|
||||||
|
|
||||||
#import <AppKit/NSImage.h>
|
#import <AppKit/NSImage.h>
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
@@ -122,7 +124,8 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)
|
|||||||
m_refData = new wxIconRefData;
|
m_refData = new wxIconRefData;
|
||||||
M_ICONDATA->m_width = bitmap.GetWidth();
|
M_ICONDATA->m_width = bitmap.GetWidth();
|
||||||
M_ICONDATA->m_height = bitmap.GetHeight();
|
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_ok = bitmap.Ok();
|
||||||
M_ICONDATA->m_numColors = 0;
|
M_ICONDATA->m_numColors = 0;
|
||||||
M_ICONDATA->m_quality = 0;
|
M_ICONDATA->m_quality = 0;
|
||||||
|
Reference in New Issue
Block a user