mirror of https://github.com/GNOME/gimp.git
use GSlice and plugged a memleak.
2007-05-22 Sven Neumann <sven@gimp.org> * app/widgets/gimppropwidgets.c (gimp_prop_aspect_ratio_new): use GSlice and plugged a memleak. svn path=/trunk/; revision=22573
This commit is contained in:
parent
af350d89e6
commit
56b52c047b
|
@ -1,3 +1,8 @@
|
|||
2007-05-22 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimppropwidgets.c (gimp_prop_aspect_ratio_new):
|
||||
use GSlice and plugged a memleak.
|
||||
|
||||
2007-05-22 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimphelp.c
|
||||
|
|
|
@ -465,13 +465,19 @@ typedef struct
|
|||
const gchar *fixed_aspect_property;
|
||||
} AspectData;
|
||||
|
||||
static void
|
||||
aspect_data_free (AspectData *data)
|
||||
{
|
||||
g_slice_free (AspectData, data);
|
||||
}
|
||||
|
||||
|
||||
static void gimp_prop_ratio_entry_notify (GObject *config,
|
||||
GParamSpec *param_spec,
|
||||
GtkEntry *entry);
|
||||
static void gimp_prop_aspect_ratio_changed (GtkWidget *widget,
|
||||
AspectData *data);
|
||||
|
||||
|
||||
/**
|
||||
* gimp_prop_aspect_ratio_new:
|
||||
* @config: Object to which property is attached.
|
||||
|
@ -497,7 +503,7 @@ gimp_prop_aspect_ratio_new (GObject *config,
|
|||
denominator_property, &denominator,
|
||||
NULL);
|
||||
|
||||
aspect_data = g_new0 (AspectData, 1);
|
||||
aspect_data = g_slice_new (AspectData);
|
||||
|
||||
aspect_data->config = config;
|
||||
aspect_data->numerator_property = numerator_property;
|
||||
|
@ -507,8 +513,9 @@ gimp_prop_aspect_ratio_new (GObject *config,
|
|||
entry = gimp_ratio_entry_new ();
|
||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), 7);
|
||||
|
||||
g_object_set_data (G_OBJECT (entry),
|
||||
"gimp-ratio-entry-aspect-data", aspect_data);
|
||||
g_object_set_data_full (G_OBJECT (entry),
|
||||
"gimp-ratio-entry-aspect-data", aspect_data,
|
||||
(GDestroyNotify) aspect_data_free);
|
||||
|
||||
gimp_ratio_entry_set_fraction (GIMP_RATIO_ENTRY (entry),
|
||||
numerator, denominator);
|
||||
|
|
Loading…
Reference in New Issue