Cocoa: Prevent crash on QWindow delete.

Clear the QCocoaWindow pointer stored on the QNSWindowHelper
when detaching from the platform window. This makes
sure callbacks from cocoa does not try access deleted
Qt window objects.

Task-number: QTBUG-39141
Change-Id: I4672eae92940dcbd59a2848e56f94b50a828bbf6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Morten Johan Sørvig 2014-05-21 11:30:54 +02:00 committed by The Qt Project
parent 8701c20f0d
commit 7ba0eb5a0d

View File

@ -182,6 +182,7 @@ static bool isMouseEvent(NSEvent *ev)
- (void)detachFromPlatformWindow - (void)detachFromPlatformWindow
{ {
_platformWindow = 0;
[self.window.delegate release]; [self.window.delegate release];
self.window.delegate = nil; self.window.delegate = nil;
} }