Don't unregister delegate notifications if same window delegate is set again

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36190 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2013-02-22 23:24:40 +00:00
parent c9f3f71f41
commit 3dab64bcc1
2 changed files with 7 additions and 0 deletions

View file

@ -5320,6 +5320,9 @@ current key view.<br />
*/
- (void) setDelegate: (id)anObject
{
if (anObject == _delegate)
return; // don't remove previously registered notifications if delegate is unchanged!
if (_delegate)
{
[nc removeObserver: _delegate name: nil object: self];