samsoffes/sstoolkit — Issue #101: dismissing SSHUDView leaves hidden view around.
Author: axfree
Created: 2011-11-02 11:23:56+00:00
State: open

In its _removeWindow method, the view should be removed from its superview(_hudWindow). unless we do this, the view will never have a change to deallocate.

- (void)_removeWindow {
// Apple doc says, you should never invoke resignKeyWindow directly
// [_hudWindow resignKeyWindow];
_hudWindow = nil;

[self removeFromSuperview];

// Return focus to the first window
[[[[UIApplication sharedApplication] windows] objectAtIndex:0] makeKeyWindow];
}

Currently, dealloc does not care the view is dismissed or not, so I think calling removeWindow again from dealloc is not a good idea.

- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];

//[self _removeWindow];
[_activityIndicator release];
[_textLabel release];
[_completeImage release];
[_failImage release];
[super dealloc];
}