Browse Source

playback: clear touch recognizers when dismissing VC

Felix Paul Kühne 11 years ago
parent
commit
134888cc83
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Sources/VLCMovieViewController.m

+ 6 - 2
Sources/VLCMovieViewController.m

@@ -78,6 +78,8 @@
 
 - (void)dealloc
 {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+
     if (_tapRecognizer)
         [self.view removeGestureRecognizer:_tapRecognizer];
     if (_swipeRecognizerLeft)
@@ -86,8 +88,10 @@
         [self.view removeGestureRecognizer:_swipeRecognizerRight];
     if (_panRecognizer)
         [self.view removeGestureRecognizer:_panRecognizer];
-
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    _tapRecognizer = nil;
+    _swipeRecognizerLeft = nil;
+    _swipeRecognizerRight = nil;
+    _panRecognizer = nil;
 }
 
 #pragma mark - Managing the media item