mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-03-24 11:24:08 +08:00
Remove GC-aware code and fix clip view leak
Remove "GC-aware" code as GC is not supported by the OS any longer. Fix leak of wxWindow::m_osxClipView by releasing it after adding it as subview.
This commit is contained in:
committed by
Vadim Zeitlin
parent
b0d50ffe91
commit
5e2caa4db9
@@ -163,10 +163,6 @@ public :
|
||||
}
|
||||
[menu setDelegate:controller];
|
||||
[m_osxMenu setImplementation:this];
|
||||
// gc aware
|
||||
if ( m_osxMenu )
|
||||
CFRetain(m_osxMenu);
|
||||
[m_osxMenu release];
|
||||
}
|
||||
|
||||
virtual ~wxMenuCocoaImpl();
|
||||
@@ -413,9 +409,7 @@ wxMenuCocoaImpl::~wxMenuCocoaImpl()
|
||||
{
|
||||
[m_osxMenu setDelegate:nil];
|
||||
[m_osxMenu setImplementation:nil];
|
||||
// gc aware
|
||||
if ( m_osxMenu )
|
||||
CFRelease(m_osxMenu);
|
||||
[m_osxMenu release];
|
||||
}
|
||||
|
||||
wxMenuImpl* wxMenuImpl::Create( wxMenu* peer, const wxString& title )
|
||||
|
||||
@@ -2730,11 +2730,6 @@ wxWidgetImpl( peer, flags )
|
||||
if ( !peer->IsShown() )
|
||||
SetVisibility(false);
|
||||
|
||||
// gc aware handling
|
||||
if ( m_osxView )
|
||||
CFRetain(m_osxView);
|
||||
[m_osxView release];
|
||||
|
||||
if ( IsUserPane() )
|
||||
ClipsToBounds(true);
|
||||
}
|
||||
@@ -2771,11 +2766,10 @@ wxWidgetCocoaImpl::~wxWidgetCocoaImpl()
|
||||
if ( sv != nil )
|
||||
[m_osxView removeFromSuperview];
|
||||
}
|
||||
// gc aware handling
|
||||
if ( m_osxView )
|
||||
CFRelease(m_osxView);
|
||||
|
||||
wxCocoaGestures::EraseForObject(this);
|
||||
|
||||
[m_osxView release];
|
||||
}
|
||||
|
||||
void wxWidgetCocoaImpl::BeginNativeKeyDownEvent( NSEvent* event )
|
||||
@@ -4315,6 +4309,7 @@ void wxWidgetCocoaImpl::UseClippingView()
|
||||
m_osxClipView = [[wxNSClipView alloc] initWithFrame: m_osxView.bounds];
|
||||
[(NSClipView*)m_osxClipView setDrawsBackground: NO];
|
||||
[m_osxView addSubview:m_osxClipView];
|
||||
[m_osxClipView release];
|
||||
|
||||
// add tracking for this clipview as well
|
||||
|
||||
|
||||
Reference in New Issue
Block a user