Cocoa: QCocoaWindow::clearNSWindow() needs to cleanup properly
clearNSWindow() should also clear the delegate and remove the contentView from the window, since we are no longer using that window. Make sure the QCocoaWindow::~QCocoaWindow() doesn't release the m_contentView until after clearNSWindow(), to avoid crashes while trying to cleanup the window and view. Change-Id: Ia081488f629a4fd4cf10fb1053fb8183b1914d35 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>bb10
parent
d8508b8139
commit
a9c49816a7
|
|
@ -111,8 +111,8 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
|
|||
|
||||
QCocoaWindow::~QCocoaWindow()
|
||||
{
|
||||
[m_contentView release];
|
||||
clearNSWindow(m_nsWindow);
|
||||
[m_contentView release];
|
||||
[m_nsWindow release];
|
||||
}
|
||||
|
||||
|
|
@ -449,7 +449,9 @@ void QCocoaWindow::setNSWindow(NSWindow *window)
|
|||
|
||||
void QCocoaWindow::clearNSWindow(NSWindow *window)
|
||||
{
|
||||
[window setDelegate:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:m_contentView];
|
||||
[m_contentView removeFromSuperviewWithoutNeedingDisplay];
|
||||
}
|
||||
|
||||
// Returns the current global screen geometry for the nswindow associated with this window.
|
||||
|
|
|
|||
Loading…
Reference in New Issue