diff options
author | Tor Lillqvist <tml@iki.fi> | 1999-10-31 12:15:34 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 1999-10-31 12:15:34 +0000 |
commit | 30cc3ed1fe251c3b5ee477152645884849037af0 (patch) | |
tree | 57cc5d0d64b525b0eba3b8a942cfbf829534effb /gcache.c | |
parent | a2760140c83d32887a0f3f16cd2a49fd2a3adb59 (diff) | |
download | glib-30cc3ed1fe251c3b5ee477152645884849037af0.tar.gz |
Don't crash if removing a nonexistent value.
1999-10-31 Tor Lillqvist <tml@iki.fi>
* gcache.c (g_cache_remove): Don't crash if removing a nonexistent
value.
* gutils.c (gwin_getlocale): New Win32-specific function, returns
a Unixish current locale string (en, zh_TW etc).
* glib.h: Declare it.
* glib.def: Export it.
* testglib.c: Test it.
* gmessages.c (Win32: ensure_stdout_valid): Some improvements,
make sure we don't call AllocConsole several times, which I think
has happened.
Diffstat (limited to 'gcache.c')
-rw-r--r-- | gcache.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -157,6 +157,9 @@ g_cache_remove (GCache *cache, key = g_hash_table_lookup (rcache->value_table, value); node = g_hash_table_lookup (rcache->key_table, key); + if (node == NULL) + return; + node->ref_count -= 1; if (node->ref_count == 0) { |