Cocoa: Clear window hash entry in ~QCocoaWindow.
The Cocoa platform plugin maintains a NSWindow-> QCocoaWindow hash. Hash entries was not properly cleared on QCocoaWindow destruction. Add call to clear the entry for the destroyed window. Make QCocoaIntegration remove the key from the hash in this case instead of setting it to 0. Task-number: QTBUG-37597 Change-Id: I3adaeee45069aea1d2ecacd948298302eafe1929 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>bb10
parent
9a747cb5b7
commit
54cc481760
|
|
@ -520,7 +520,10 @@ NSToolbar *QCocoaIntegration::toolbar(QWindow *window) const
|
|||
|
||||
void QCocoaIntegration::setWindow(NSWindow* nsWindow, QCocoaWindow *window)
|
||||
{
|
||||
mWindows.insert(nsWindow, window);
|
||||
if (window == 0)
|
||||
mWindows.remove(nsWindow);
|
||||
else
|
||||
mWindows.insert(nsWindow, window);
|
||||
}
|
||||
|
||||
QCocoaWindow *QCocoaIntegration::window(NSWindow *window)
|
||||
|
|
|
|||
|
|
@ -420,6 +420,9 @@ QCocoaWindow::~QCocoaWindow()
|
|||
qDebug() << "QCocoaWindow::~QCocoaWindow" << this;
|
||||
#endif
|
||||
|
||||
if (QCocoaIntegration *ci = QCocoaIntegration::instance())
|
||||
ci->setWindow(m_nsWindow, 0);
|
||||
|
||||
QCocoaAutoReleasePool pool;
|
||||
[m_nsWindow setContentView:nil];
|
||||
[m_nsWindow.helper detachFromPlatformWindow];
|
||||
|
|
|
|||
Loading…
Reference in New Issue