X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f3f56f2fe2a5931e8ec97bacb81d7fdd30ba6909..94f0292941b6520afbabc999da698ef5fe576a46:/src/cocoa/toplevel.mm?ds=sidebyside diff --git a/src/cocoa/toplevel.mm b/src/cocoa/toplevel.mm index a23e990cab..b4b55f1b53 100644 --- a/src/cocoa/toplevel.mm +++ b/src/cocoa/toplevel.mm @@ -32,6 +32,7 @@ #include "wx/cocoa/autorelease.h" #include "wx/cocoa/string.h" +#include "wx/cocoa/ObjcRef.h" #include "wx/cocoa/objc/NSView.h" #include "wx/cocoa/objc/NSWindow.h" @@ -190,8 +191,8 @@ void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow) bool need_debug = cocoaNSWindow || m_cocoaNSWindow; if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d"),this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]); DisassociateNSWindow(m_cocoaNSWindow); - [cocoaNSWindow retain]; - [m_cocoaNSWindow release]; + wxGCSafeRetain(cocoaNSWindow); + wxGCSafeRelease(m_cocoaNSWindow); m_cocoaNSWindow = cocoaNSWindow; // NOTE: We are no longer using posing so we won't get events on the // window's view unless it was explicitly created as the wx view class.