From f1a2ef83e0577344c57ab9e769c37bf4ae982a91 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 20 Jun 2020 08:04:25 +0200 Subject: [PATCH 10/21] python: check if hashtable is NULL before deallocatio (#44287)n --- bindings/python/lang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/lang.py b/bindings/python/lang.py index b9d86f45..582ba136 100644 --- a/bindings/python/lang.py +++ b/bindings/python/lang.py @@ -91,7 +91,7 @@ class Binding: k_type = key_type(type) v_type = value_type(type) if is_cstring(el_type) or (is_cstring(k_type) and is_cstring(v_type)): - print_(' g_hash_table_destroy(%s);' % name, file=fd) + print_(' if (%s) { g_hash_table_destroy(%s); }' % (name, name), file=fd) else: raise Exception('Unsupported free value of type GHashTable: %s' % type) elif is_object(type): -- 2.26.2