mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Properly initialize reference count for a new setting, bug #235.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4452 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
8efa5e6ce7
commit
27ec7f0f1e
@ -181,8 +181,10 @@ static void settings_add(const char *module, const char *section,
|
||||
"setting '%s' with different type.", key);
|
||||
return;
|
||||
}
|
||||
rec->refcount++;
|
||||
} else {
|
||||
rec = g_new(SETTINGS_REC, 1);
|
||||
rec->refcount = 1;
|
||||
rec->module = g_strdup(module);
|
||||
rec->key = g_strdup(key);
|
||||
rec->section = g_strdup(section);
|
||||
@ -191,8 +193,6 @@ static void settings_add(const char *module, const char *section,
|
||||
rec->default_value = *default_value;
|
||||
g_hash_table_insert(settings, rec->key, rec);
|
||||
}
|
||||
|
||||
rec->refcount++;
|
||||
}
|
||||
|
||||
void settings_add_str_module(const char *module, const char *section,
|
||||
|
Loading…
Reference in New Issue
Block a user