From 41c1f27fe53334bc4ab2ca791ab93050a6a67253 Mon Sep 17 00:00:00 2001 From: rfm Date: Sun, 24 Apr 2016 08:38:42 +0000 Subject: [PATCH] fix updating command settings ... if there's no change, don't update domain git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@39690 72102866-910b-0410-8b05-ffd578937521 --- EcUserDefaults.m | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/EcUserDefaults.m b/EcUserDefaults.m index 725b798..cc927ef 100644 --- a/EcUserDefaults.m +++ b/EcUserDefaults.m @@ -355,15 +355,19 @@ static NSLock *lock = nil; } if (nil != new) { - if (nil != old) - { - [self removeVolatileDomainForName: @"EcCommand"]; - } - [self setVolatileDomain: new forName: @"EcCommand"]; + if (NO == [new isEqual: old]) + { + if (nil != old) + { + [self removeVolatileDomainForName: @"EcCommand"]; + } + [self setVolatileDomain: new forName: @"EcCommand"]; + [new release]; + [[NSNotificationCenter defaultCenter] postNotificationName: + NSUserDefaultsDidChangeNotification object: self]; + return YES; + } [new release]; - [[NSNotificationCenter defaultCenter] postNotificationName: - NSUserDefaultsDidChangeNotification object: self]; - return YES; } return NO; }