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:
Stefan Csomor
2009-08-19 13:01:08 +00:00
parent aa30d6c896
commit 9a038ddca4
2 changed files with 15 additions and 3 deletions

View File

@@ -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 )

View File

@@ -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