Cocoa: remove current contentView when clearing window
Otherwise they might be still events sent to view with no proper QWindow. Also, add dealloc QNSView for clean up. Task-number: QTBUG-26580 Task-number: QTBUG-27456 Change-Id: Icdbe5c39490b72ec82795c2d71e5671cea81921e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
932bf57ea2
commit
037d1e18e3
@ -713,6 +713,7 @@ void QCocoaWindow::setNSWindow(NSWindow *window)
|
||||
|
||||
void QCocoaWindow::clearNSWindow(NSWindow *window)
|
||||
{
|
||||
[window setContentView:nil];
|
||||
[window setDelegate:nil];
|
||||
[window clearPlatformWindow];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:m_contentView];
|
||||
|
@ -89,6 +89,14 @@ static QTouchDevice *touchDevice = 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
CGImageRelease(m_cgImage);
|
||||
m_cgImage = 0;
|
||||
m_window = 0;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id)initWithQWindow:(QWindow *)window platformWindow:(QCocoaWindow *) platformWindow
|
||||
{
|
||||
self = [self init];
|
||||
|
Loading…
Reference in New Issue
Block a user