mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 04:50:47 +00:00
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:
parent
be53d46c81
commit
33c6fe9e83
2 changed files with 11 additions and 0 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue