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
@@ -105,6 +105,8 @@
} }
- (void)willMoveToParentViewController:(UIViewController *)parent { - (void)willMoveToParentViewController:(UIViewController *)parent {
// Only cleanup when we're being destroyed
if (parent == nil) {
[_controllerSupport cleanup]; [_controllerSupport cleanup];
[UIApplication sharedApplication].idleTimerDisabled = NO; [UIApplication sharedApplication].idleTimerDisabled = NO;
[_streamMan stopStream]; [_streamMan stopStream];
@@ -113,6 +115,7 @@
_inactivityTimer = nil; _inactivityTimer = nil;
} }
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
}
} }
- (void) returnToMainFrame { - (void) returnToMainFrame {