Commit 1f41004d authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'aggraef/purr-data-osx-prefs-fix'

parents acd148a5 890310eb
...@@ -268,6 +268,8 @@ static char *sys_prefbuf; ...@@ -268,6 +268,8 @@ static char *sys_prefbuf;
// prefs is *much* faster now than with the previous method which invoked // prefs is *much* faster now than with the previous method which invoked
// 'defaults read' on each individual key. // 'defaults read' on each individual key.
static int save_prefs_later = 0;
static void sys_initloadpreferences(void) static void sys_initloadpreferences(void)
{ {
char cmdbuf[MAXPDSTRING], *buf; char cmdbuf[MAXPDSTRING], *buf;
...@@ -308,6 +310,8 @@ static void sys_initloadpreferences(void) ...@@ -308,6 +310,8 @@ static void sys_initloadpreferences(void)
// Read from the package defaults and write to the user prefs. // Read from the package defaults and write to the user prefs.
prefs = default_prefs; prefs = default_prefs;
strncpy(current_prefs, user_prefs, FILENAME_MAX); strncpy(current_prefs, user_prefs, FILENAME_MAX);
// AG: Remember to save the prefs later after we loaded them (see below).
save_prefs_later = 1;
} }
// This looks complicated, but is rather straightforward. The individual // This looks complicated, but is rather straightforward. The individual
// stages of the pipe are: // stages of the pipe are:
...@@ -405,6 +409,14 @@ static void sys_doneloadpreferences( void) ...@@ -405,6 +409,14 @@ static void sys_doneloadpreferences( void)
if (sys_prefbuf) if (sys_prefbuf)
free(sys_prefbuf); free(sys_prefbuf);
sys_prefbuf = NULL; sys_prefbuf = NULL;
if (save_prefs_later) {
// AG: We need to save the default prefs to the user prefs at this point
// in order to avoid losing them, in case the recent file list is written
// without first saving the defaults (fixes #339).
extern void glob_savepreferences(t_pd *dummy);
glob_savepreferences(NULL);
save_prefs_later = 0;
}
} }
// AG: We use a similar approach here to import the data into the defaults // AG: We use a similar approach here to import the data into the defaults
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment