From 41c3e4644b145a21c012e170b9212dfa5686ec51 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Fri, 27 May 2005 13:41:46 +0000 Subject: [PATCH] Make sure popup button cells wont get notifications after being dealloceated. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21266 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSPopUpButtonCell.m | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4de5f5da6..1091b1b8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-05-27 Fred Kiefer + + * Source/NSPopupButton.m (-dealloc) Dismiss the popup. This is to + make sure the removed popup no longer gets notifications. may + happen when the cell gets deallocated without closing the popup. + 2005-05-26 Fred Kiefer * Source/NSTableView.m (-mouseDown): Replaced use of diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 181be0fd7..2712a1e43 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -85,6 +85,12 @@ static NSImage *_pbc_image[2]; - (void) dealloc { + /* + * The popup must be closed here, just in case the cell goes away + * while the popup is still displayed. In that case the notification + * center would still send notifications to the deallocated cell. + */ + [self dismissPopUp]; /* * We don't use methods here to clean up the selected item, the menu * item and the menu as these methods internally update the menu,