Re: Strange GHashTable behaviour
- From: Luka Napotnik <luka napotnik gmail com>
- To: Vivien Malerba <vmalerba gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Strange GHashTable behaviour
- Date: Wed, 22 Apr 2009 02:20:58 +0200
The problem is in the returned value. It returns an invalid pointer
instead of NULL.
Greets,
Luka
Dne 21.04.2009 (tor) ob 17:19 +0200 je Vivien Malerba zapisal(a):
2009/4/21 Luka Napotnik <luka napotnik gmail com>
Hello,
I'm experiencing strange GHashTable behaviours when looking up
a value
throught a string key. I pass the key as a stack-allocated
string to the
hash table. For most lookups it works flawlessly but sometimes
I get an
invalid pointer. It even looks normal but data can't be
accessed at that
address.
I have about 50 unique UUID keys and I'm inserting them to the
hash
table one by one with an associated data pointer. AFAIK,
g_hash_table_lookup() should return NULL when the element with
the
provided key was not found in the table.
So, does anyone have an idea what is going on here? Please
help.
Is the problem on the key or on the returned value of a
g_hash_table_lookup()?
Did you give any destroy functions to g_hash_table_new_full() and use
g_hash_table_insert() again with the same key?
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]