Ignore config changes during shutdown

This commit is contained in:
Richard Frith-Macdonald 2018-01-04 11:30:24 +00:00
parent 1d05222942
commit c2983d4c3b
2 changed files with 11 additions and 1 deletions

View file

@ -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 <rfm@gnu.org>

View file

@ -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.