Stop observing notifications from a pop up button's menu when the

button is deallocated to prevent obscure crashes later.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32513 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2011-03-09 10:52:43 +00:00
parent 731f62b0e3
commit b0af15ff80
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2011-03-09 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSPopUpButtonCell.m (-dealloc): Stop observing
notifications from the button's menu to prevent obscure crashes
later.
2011-03-09 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSMatrix.m (_altModifier:): Fix swapped macro arguments,

View file

@ -147,6 +147,11 @@ static NSImage *_pbc_image[5];
* so the local reference to it is invalid and will result in a
* segmentation fault.
*/
if (_menu != nil)
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc removeObserver: self name: nil object: _menu];
}
_selectedItem = nil;
[super dealloc];
}