Skip to content

Commit 2be25a7

Browse files
Remove notification observer and cancel nw_path_monitor
1 parent 54df708 commit 2be25a7

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

AppBox/ViewController/ABHudViewController/ABHudViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,8 @@ -(void)setHudType:(HudType)hudType{
111111
}
112112
}
113113

114+
- (void)dealloc {
115+
[[NSNotificationCenter defaultCenter] removeObserver:self];
116+
}
117+
114118
@end

AppBox/ViewController/DropboxViewController/DropboxViewController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ - (void)handleLoggedInNotification:(NSNotification *)notification{
4141
[self dismissController:self];
4242
}
4343

44-
44+
- (void)dealloc {
45+
[[NSNotificationCenter defaultCenter] removeObserver:self];
46+
}
4547

4648
@end

AppBox/ViewController/HomeViewController/HomeViewController.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,4 +503,12 @@ -(void)prepareForSegue:(NSStoryboardSegue *)segue sender:(id)sender{
503503
}
504504
}
505505

506+
- (void)dealloc {
507+
[[NSNotificationCenter defaultCenter] removeObserver:self];
508+
if (_pathMonitor) {
509+
nw_path_monitor_cancel(_pathMonitor);
510+
_pathMonitor = nil;
511+
}
512+
}
513+
506514
@end

0 commit comments

Comments
 (0)