summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview.mm
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-08-20 16:55:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-04 17:52:20 +0200
commit8fd71914b43350a21c0c05051c1a6e24e9d8cb85 (patch)
tree4389e741a4f8d8fbc6f23338a59b9d4252b64470 /src/plugins/platforms/cocoa/qnsview.mm
parenta2bdda8e3ba324a51620d9e758e444d02c4fd061 (diff)
Cocoa: Unregister view from window's notifications only
Otherwise the view will miss its own frame change notifications. And we must unregister from all the notifications during dealloc. This would also reveal a bug where we would expose an NSView before its super view is visible, leading to those "invalid drawable" warnings when using QQuickViews. Therefore, we add this extra check in QCocoaWindow::exposeWindow(). Task-number: QTBUG-32826 Change-Id: I69018cb6f199b242768d114b2aa34c7f2d243196 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.mm')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index c6dce8b6f6..c2ffe96f8c 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -107,12 +107,9 @@ static QTouchDevice *touchDevice = 0;
m_maskImage = 0;
m_maskData = 0;
m_window = 0;
- if (m_subscribesForGlobalFrameNotifications) {
- m_subscribesForGlobalFrameNotifications = false;
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:NSViewGlobalFrameDidChangeNotification
- object:self];
-}
+ m_subscribesForGlobalFrameNotifications = false;
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
delete currentCustomDragTypes;
[super dealloc];