adding gc aware code, fixes #11061
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
|
||||
@end
|
||||
|
||||
@interface wxNSMenuController : NSObject
|
||||
@interface wxNSMenuController : NSObject <NSMenuDelegate>
|
||||
{
|
||||
}
|
||||
|
||||
@@ -133,6 +133,10 @@ public :
|
||||
}
|
||||
[menu setDelegate:controller];
|
||||
[m_osxMenu setImplementation:this];
|
||||
// gc aware
|
||||
if ( m_osxMenu )
|
||||
CFRetain(m_osxMenu);
|
||||
[m_osxMenu release];
|
||||
}
|
||||
|
||||
virtual ~wxMenuCocoaImpl();
|
||||
@@ -196,7 +200,9 @@ wxMenuCocoaImpl::~wxMenuCocoaImpl()
|
||||
{
|
||||
[m_osxMenu setDelegate:nil];
|
||||
[m_osxMenu setImplementation:nil];
|
||||
[m_osxMenu release];
|
||||
// gc aware
|
||||
if ( m_osxMenu )
|
||||
CFRelease(m_osxMenu);
|
||||
}
|
||||
|
||||
wxMenuImpl* wxMenuImpl::Create( wxMenu* peer, const wxString& title )
|
||||
|
||||
@@ -1127,6 +1127,10 @@ wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRoo
|
||||
{
|
||||
Init();
|
||||
m_osxView = w;
|
||||
// gc aware handling
|
||||
if ( m_osxView )
|
||||
CFRetain(m_osxView);
|
||||
[m_osxView release];
|
||||
}
|
||||
|
||||
wxWidgetCocoaImpl::wxWidgetCocoaImpl()
|
||||
@@ -1152,7 +1156,9 @@ wxWidgetCocoaImpl::~wxWidgetCocoaImpl()
|
||||
if ( sv != nil )
|
||||
[m_osxView removeFromSuperview];
|
||||
}
|
||||
[m_osxView release];
|
||||
// gc aware handling
|
||||
if ( m_osxView )
|
||||
CFRelease(m_osxView);
|
||||
}
|
||||
|
||||
bool wxWidgetCocoaImpl::IsVisible() const
|
||||
|
||||
Reference in New Issue
Block a user