Handle multiple deinit of callable cache
In python3, it seems that the callable cache deinit can be called multiple times when the program is exiting. Make that safer by clearing the various pointers in the structure using g_clear_pointer and Py_CLEAR. A subsequent call will skip all the deinit by seeing NULL pointers for the members. This was causing a critical warning when destroying the arg name hash table multiple times with the following trivial program: $ python3 -c 'from gi.repository import GLib; v = GLib.Variant("s", "foo")' (process:32378): GLib-CRITICAL **: g_hash_table_destroy: assertion 'hash_table != NULL' failed (process:32378): GLib-CRITICAL **: g_hash_table_destroy: assertion 'hash_table != NULL' failed https://bugzilla.gnome.org/show_bug.cgi?id=776092
parent
94226b8e
Please register or sign in to comment