From c2983d4c3b9b187b6c0be2c1df2b72cc2580545c Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Thu, 4 Jan 2018 11:30:24 +0000 Subject: [PATCH] Ignore config changes during shutdown --- ChangeLog | 2 +- EcProcess.m | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 30e8325..79c85a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,7 @@ Rewrite config update code to catch exceptions, ensure that methods are called in the correct order so that -cmdUpdated is always last, and ensure that -cmdUpdated is called when a local defaults update - occurs. + occurs. Also, ignore config updates while process is quitting. 2017-12-04 Richard Frith-Macdonald diff --git a/EcProcess.m b/EcProcess.m index e07309e..01cfbe8 100644 --- a/EcProcess.m +++ b/EcProcess.m @@ -1423,6 +1423,11 @@ static NSString *noFiles = @"No log files to archive"; { return; // Ignore defaults updates during configuration update. } + if (YES == ecIsQuitting()) + { + NSLog(@"NSUserDefaults change during process shutdown ... ignored."); + return; // Ignore defaults changes during shutdown. + } if (nil == configError) { NS_DURING @@ -5285,6 +5290,11 @@ With two parameters ('maximum' and a number),\n\ NSEnumerator *enumerator; NSString *key; + if (YES == ecIsQuitting()) + { + NSLog(@"Configuration change during process shutdown ... ignored."); + return; // Ignore config updates while quitting + } newConfig = [NSMutableDictionary dictionaryWithCapacity: 32]; /* * Put all values for this application in the cmdConf dictionary.