diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-09-26 16:22:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 22:25:10 +0200 |
commit | f37990712b217b4f8136d70675cb259f61548556 (patch) | |
tree | 93965fe953c1a5fe349a4793cbac93604fd516c9 /src/plugins/platforms | |
parent | 5b70efb1258fd7435e8cfbed1a54abb46db0adcc (diff) |
[QNSView viewWillMoveToWindow:] remove observer from previous window
Even if there is not a new window, the notifications from the old one
are not needed.
Change-Id: I9c1858d25e49379ca4737e23beec06623e91b69c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index b8a31329fe..ab098b08bf 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -204,9 +204,9 @@ static QTouchDevice *touchDevice = 0; selector:@selector(windowNotification:) name:nil // Get all notifications object:newWindow]; - } else { - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:[self window]]; } + if ([self window]) + [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:[self window]]; } - (void)updateGeometry { |