app, pdb: initialize the "config" object for custom GIMP operations.
If the config object is NULL, we later face crashes! My guess is that we had only been testing editing custom ops, but not creating them from public API!
This commit is contained in:
parent
38c33eb6a0
commit
528cd1905a
2 changed files with 22 additions and 0 deletions
|
|
@ -165,6 +165,17 @@ drawable_filter_new_invoker (GimpProcedure *procedure,
|
|||
gegl_node_set (operation,
|
||||
"operation", operation_name,
|
||||
NULL);
|
||||
if (gimp_operation_config_is_custom (gimp, operation_name))
|
||||
{
|
||||
GParamSpec *pspec = gegl_node_find_property (operation, "config");
|
||||
GType otype = pspec->value_type;
|
||||
GObject *config = g_object_new (otype, NULL);
|
||||
|
||||
gegl_node_set (operation, "config", config, NULL);
|
||||
|
||||
g_object_unref (config);
|
||||
}
|
||||
|
||||
filter = gimp_drawable_filter_new (drawable, name, operation, NULL);
|
||||
/* We don't have a libgimp function for setting the clipping
|
||||
* behavior. I want to look further into the whole logic first.
|
||||
|
|
|
|||
|
|
@ -82,6 +82,17 @@ HELP
|
|||
gegl_node_set (operation,
|
||||
"operation", operation_name,
|
||||
NULL);
|
||||
if (gimp_operation_config_is_custom (gimp, operation_name))
|
||||
{
|
||||
GParamSpec *pspec = gegl_node_find_property (operation, "config");
|
||||
GType otype = pspec->value_type;
|
||||
GObject *config = g_object_new (otype, NULL);
|
||||
|
||||
gegl_node_set (operation, "config", config, NULL);
|
||||
|
||||
g_object_unref (config);
|
||||
}
|
||||
|
||||
filter = gimp_drawable_filter_new (drawable, name, operation, NULL);
|
||||
/* We don't have a libgimp function for setting the clipping
|
||||
* behavior. I want to look further into the whole logic first.
|
||||
|
|
|
|||
Loading…
Reference in a new issue