mirror of https://github.com/GNOME/gimp.git
app: don't leak options->language; add finalize() to free it
This commit is contained in:
parent
cf1cc6dc6f
commit
94e757df51
|
@ -70,6 +70,7 @@ enum
|
|||
};
|
||||
|
||||
|
||||
static void gimp_text_options_finalize (GObject *object);
|
||||
static void gimp_text_options_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
|
@ -98,12 +99,15 @@ G_DEFINE_TYPE_WITH_CODE (GimpTextOptions, gimp_text_options,
|
|||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_RECTANGLE_OPTIONS,
|
||||
NULL))
|
||||
|
||||
#define parent_class gimp_text_options_parent_class
|
||||
|
||||
|
||||
static void
|
||||
gimp_text_options_class_init (GimpTextOptionsClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gimp_text_options_finalize;
|
||||
object_class->set_property = gimp_text_options_set_property;
|
||||
object_class->get_property = gimp_text_options_get_property;
|
||||
|
||||
|
@ -206,6 +210,20 @@ gimp_text_options_init (GimpTextOptions *options)
|
|||
options->size_entry = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_text_options_finalize (GObject *object)
|
||||
{
|
||||
GimpTextOptions *options = GIMP_TEXT_OPTIONS (object);
|
||||
|
||||
if (options->language)
|
||||
{
|
||||
g_free (options->language);
|
||||
options->language = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_text_options_get_property (GObject *object,
|
||||
guint property_id,
|
||||
|
|
Loading…
Reference in New Issue