soffes / sstoolkit

A collection of well-documented iOS classes for making life easier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dismissing SSHUDView leaves hidden view around.

axfree opened this issue · comments

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];
    }