X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f55c979a009b3c364e60731670f5698b448ba963..3e1924dd5f5744c3e2a8973de9b3e4f372b7fd85:/src/cocoa/pen.mm?ds=sidebyside diff --git a/src/cocoa/pen.mm b/src/cocoa/pen.mm index b5e6e36065..d94b138c1a 100644 --- a/src/cocoa/pen.mm +++ b/src/cocoa/pen.mm @@ -17,6 +17,8 @@ #include "wx/colour.h" #endif //WX_PRECOMP +#include "wx/cocoa/ObjcRef.h" + #import // ======================================================================== @@ -133,13 +135,13 @@ inline wxPenRefData::wxPenRefData(const wxPenRefData& data) m_nbDash = data.m_nbDash; m_dash = data.m_dash; m_stipple = data.m_stipple; - m_cocoaNSColor = [data.m_cocoaNSColor retain]; + m_cocoaNSColor = wxGCSafeRetain(data.m_cocoaNSColor); m_cocoaDash = NULL; } inline void wxPenRefData::FreeCocoaNSColor() { - [m_cocoaNSColor release]; + wxGCSafeRelease(m_cocoaNSColor); m_cocoaNSColor = nil; } @@ -156,7 +158,7 @@ inline WX_NSColor wxPenRefData::GetNSColor() switch( m_style ) { case wxTRANSPARENT: - m_cocoaNSColor = [[NSColor clearColor] retain]; + m_cocoaNSColor = wxGCSafeRetain([NSColor clearColor]); break; case wxSTIPPLE: // wxBitmap isn't implemented yet @@ -181,6 +183,7 @@ inline WX_NSColor wxPenRefData::GetNSColor() if(!colour_NSColor) colour_NSColor = [NSColor clearColor]; m_cocoaNSColor = [colour_NSColor copyWithZone:nil]; + [wxGCSafeRetain(m_cocoaNSColor) release]; // retain in GC. no change in RR. break; } } @@ -266,12 +269,12 @@ wxPen::wxPen(const wxBitmap& stipple, int width) m_refData = new wxPenRefData(wxNullColour,width,wxSTIPPLE,stipple); } -wxObjectRefData *wxPen::CreateRefData() const +wxGDIRefData *wxPen::CreateGDIRefData() const { return new wxPenRefData; } -wxObjectRefData *wxPen::CloneRefData(const wxObjectRefData *data) const +wxGDIRefData *wxPen::CloneGDIRefData(const wxGDIRefData *data) const { return new wxPenRefData(*(wxPenRefData *)data); }