I think this is problematic, at least I encountered problems when passing a key that lives on the stack to g_hash_table_insert and later tried to clean the event when that key was no longer on the stack.