[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>
This commit is contained in:
Shawn Rutledge 2013-09-26 16:22:19 +02:00 committed by The Qt Project
parent 5b70efb125
commit f37990712b

View File

@ -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
{