jessesquires / BButton

Twitter Bootstrap buttons for iOS
http://cocoadocs.org/docsets/BButton/
Other
712 stars 82 forks source link

Memory warning observer never deleted #15

Closed banaslee closed 11 years ago

banaslee commented 11 years ago

I'm still not able to contribute to the project with code but I've found that the button never deletes himself as an observer of memory warning notifications.

This was leading my app to crashes when memory was low.

I suggest changing the dealloc code to

- (void)dealloc
{
    _color = nil;
    _buttonCornerRadius = nil;
    kFontAwesomeStrings = nil;

    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
}
jessesquires commented 11 years ago

thanks @banaslee ! good catch