diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index a60a0ca4d..e38bb42f5 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -138,6 +138,7 @@ static NSImage *_pbc_image[5]; - (void) dealloc { + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; /* * The popup must be closed here, just in case the cell goes away * while the popup is still displayed. In that case the notification @@ -150,7 +151,10 @@ static NSImage *_pbc_image[5]; if (_menu != nil) { - [self setMenu: nil]; + [_menu _setOwnedByPopUp: nil]; + [nc removeObserver: self + name: nil + object: _menu]; } _selectedItem = nil; [super dealloc];