void Cleanup() { frameRateLabel.Dispose(); dimensionsLabel.Dispose(); typeLabel.Dispose(); var notificationCenter = NSNotificationCenter.DefaultCenter; notificationCenter.RemoveObserver(this, UIDevice.OrientationDidChangeNotification, UIApplication.SharedApplication); UIDevice.CurrentDevice.EndGeneratingDeviceOrientationNotifications(); notificationCenter.RemoveObserver(this, UIApplication.DidBecomeActiveNotification, UIApplication.SharedApplication); // Stop and tear down the capture session videoProcessor.StopAndTearDownCaptureSession(); videoProcessor.Dispose(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (timer != null) { timer.Invalidate(); timer.Dispose(); timer = null; } if (videoProcessor != null) { videoProcessor.Dispose(); videoProcessor = null; } }