Skip to content

Commit

Permalink
Cocoa: Make sure child windows' QNSView is properly released
Browse files Browse the repository at this point in the history
Child QCocoaWindows don't have an assigned NSWindow, but still get a
QNSView as backing store. That QNSView is added as a subview to
the parent window's QNSView. That would leave an unmanaged QNSView
alive.

Change-Id: I10f57fb971f7aa1e278bb0af4217052d1e4bb0bc
Reviewed-by: Richard Moe Gustavsen <[email protected]>
  • Loading branch information
Gabriel de Dietrich authored and The Qt Project committed Nov 23, 2012
1 parent 4bddcf9 commit 8a091a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/platforms/cocoa/qcocoawindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ - (void)clearPlatformWindow

QCocoaAutoReleasePool pool;
clearNSWindow(m_nsWindow);
if (parent())
[m_contentView removeFromSuperview];
[m_contentView release];
[m_nsWindow release];
[m_nsWindowDelegate release];
Expand Down

0 comments on commit 8a091a8

Please sign in to comment.