Only cleanup the stream on termination

This commit is contained in:
Cameron Gutman
2018-12-28 02:03:21 -08:00
parent c8adc184c9
commit d466a0af07

View File

@@ -105,14 +105,17 @@
}
- (void)willMoveToParentViewController:(UIViewController *)parent {
[_controllerSupport cleanup];
[UIApplication sharedApplication].idleTimerDisabled = NO;
[_streamMan stopStream];
if (_inactivityTimer != nil) {
[_inactivityTimer invalidate];
_inactivityTimer = nil;
// Only cleanup when we're being destroyed
if (parent == nil) {
[_controllerSupport cleanup];
[UIApplication sharedApplication].idleTimerDisabled = NO;
[_streamMan stopStream];
if (_inactivityTimer != nil) {
[_inactivityTimer invalidate];
_inactivityTimer = nil;
}
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void) returnToMainFrame {