Commit 88befd30 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 664591 - Spyrogimp script crashes GIMP

Don't let resetting the tool options reset away their name to NULL.
Found by massimo.
parent 53427d7b
......@@ -50,23 +50,29 @@ enum
};
static void gimp_tool_options_dispose (GObject *object);
static void gimp_tool_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_tool_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_tool_options_config_iface_init (GimpConfigInterface *iface);
static void gimp_tool_options_real_reset (GimpToolOptions *tool_options);
static void gimp_tool_options_dispose (GObject *object);
static void gimp_tool_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_tool_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_tool_options_tool_notify (GimpToolOptions *options,
GParamSpec *pspec);
static void gimp_tool_options_real_reset (GimpToolOptions *tool_options);
static void gimp_tool_options_config_reset (GimpConfig *config);
G_DEFINE_TYPE (GimpToolOptions, gimp_tool_options, GIMP_TYPE_CONTEXT)
static void gimp_tool_options_tool_notify (GimpToolOptions *options,
GParamSpec *pspec);
G_DEFINE_TYPE_WITH_CODE (GimpToolOptions, gimp_tool_options, GIMP_TYPE_CONTEXT,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_tool_options_config_iface_init))
#define parent_class gimp_tool_options_parent_class
......@@ -102,6 +108,12 @@ gimp_tool_options_init (GimpToolOptions *options)
NULL);
}
static void
gimp_tool_options_config_iface_init (GimpConfigInterface *iface)
{
iface->reset = gimp_tool_options_config_reset;
}
static void
gimp_tool_options_dispose (GObject *object)
{
......@@ -233,6 +245,16 @@ gimp_tool_options_real_reset (GimpToolOptions *tool_options)
gimp_config_reset (GIMP_CONFIG (tool_options));
}
static void
gimp_tool_options_config_reset (GimpConfig *config)
{
gchar *name = g_strdup (gimp_object_get_name (config));
gimp_config_reset_properties (G_OBJECT (config));
gimp_object_take_name (GIMP_OBJECT (config), name);
}
static void
gimp_tool_options_tool_notify (GimpToolOptions *options,
GParamSpec *pspec)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment