Fix leak of UIComputerViews that poll forever

This commit is contained in:
Cameron Gutman
2018-12-27 19:50:29 -08:00
parent 3555d60a9b
commit dc00c1e3e7

View File

@@ -183,7 +183,11 @@ static const int LABEL_DY = 20;
- (void) updateLoop {
[self updateContentsForHost:_host];
[self performSelector:@selector(updateLoop) withObject:self afterDelay:REFRESH_CYCLE];
// Stop updating when we detach from our parent view
if (self.superview != nil) {
[self performSelector:@selector(updateLoop) withObject:self afterDelay:REFRESH_CYCLE];
}
}
- (void) hostLongClicked:(UILongPressGestureRecognizer*)gesture {