[gegl] operation: allow a NULL value in gegl_param_spec_set_property_key()



commit ed03d6da9127eda7344a9d83257ffea1446f33e4
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jun 19 09:38:31 2020 +0200

    operation: allow a NULL value in gegl_param_spec_set_property_key()
    
    so values can be unset.

 gegl/operation/gegl-operation-property-keys.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gegl/operation/gegl-operation-property-keys.c b/gegl/operation/gegl-operation-property-keys.c
index 7d5cc68fc..f03c77eb9 100644
--- a/gegl/operation/gegl-operation-property-keys.c
+++ b/gegl/operation/gegl-operation-property-keys.c
@@ -63,7 +63,11 @@ gegl_param_spec_set_property_key (GParamSpec  *pspec,
 {
   GHashTable *ht;
   ht = gegl_param_spec_get_property_key_ht (pspec, TRUE);
-  g_hash_table_insert (ht, g_strdup (key_name), g_strdup (value));
+
+  if (value)
+    g_hash_table_insert (ht, g_strdup (key_name), g_strdup (value));
+  else
+    g_hash_table_remove (ht, key_name);
 }
 
 static GHashTable *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]