summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-04-16 00:27:43 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-04-16 00:27:43 +0000
commit27ec7f0f1e7aaddec8eb4ce9f23922c0fcab999a (patch)
tree511d5dc586146b34f8222e4055645cc4f915ce69
parent8efa5e6ce7abc6c2c8aa1662802d702b9e6ee338 (diff)
downloadirssi-27ec7f0f1e7aaddec8eb4ce9f23922c0fcab999a.zip
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
-rw-r--r--src/core/settings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/settings.c b/src/core/settings.c
index be49d800..28036438 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -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,