Bug 664591 - Spyrogimp script crashes GIMP
Don't let resetting the tool options reset away their name to NULL. Found by massimo.
This commit is contained in:
@ -50,6 +50,8 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void gimp_tool_options_config_iface_init (GimpConfigInterface *iface);
|
||||||
|
|
||||||
static void gimp_tool_options_dispose (GObject *object);
|
static void gimp_tool_options_dispose (GObject *object);
|
||||||
static void gimp_tool_options_set_property (GObject *object,
|
static void gimp_tool_options_set_property (GObject *object,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
@ -62,11 +64,15 @@ static void gimp_tool_options_get_property (GObject *object,
|
|||||||
|
|
||||||
static void gimp_tool_options_real_reset (GimpToolOptions *tool_options);
|
static void gimp_tool_options_real_reset (GimpToolOptions *tool_options);
|
||||||
|
|
||||||
|
static void gimp_tool_options_config_reset (GimpConfig *config);
|
||||||
|
|
||||||
static void gimp_tool_options_tool_notify (GimpToolOptions *options,
|
static void gimp_tool_options_tool_notify (GimpToolOptions *options,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GimpToolOptions, gimp_tool_options, GIMP_TYPE_CONTEXT)
|
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
|
#define parent_class gimp_tool_options_parent_class
|
||||||
|
|
||||||
@ -102,6 +108,12 @@ gimp_tool_options_init (GimpToolOptions *options)
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_tool_options_config_iface_init (GimpConfigInterface *iface)
|
||||||
|
{
|
||||||
|
iface->reset = gimp_tool_options_config_reset;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_tool_options_dispose (GObject *object)
|
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));
|
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
|
static void
|
||||||
gimp_tool_options_tool_notify (GimpToolOptions *options,
|
gimp_tool_options_tool_notify (GimpToolOptions *options,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
|
Reference in New Issue
Block a user