瀏覽代碼

playback: clear touch recognizers when dismissing VC

Felix Paul Kühne 11 年之前
父節點
當前提交
134888cc83
共有 1 個文件被更改,包括 6 次插入2 次删除
  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