date-chooser: Fix GDateTime leak
By using finalize and dispose methods and calling the proper free method. 8,806 (64 direct, 8,742 indirect) bytes in 2 blocks are definitely lost in loss record 18,051 of 18,131 at 0x4C2DB9D: malloc (vg_replace_malloc.c:299) by 0x9A0C90E: g_malloc (gmem.c:94) by 0x9A26A55: g_slice_alloc (gslice.c:1025) by 0x9A26A95: g_slice_alloc0 (gslice.c:1051) by 0x99E8DC4: g_date_time_alloc (gdatetime.c:428) by 0x99E95C1: g_date_time_new (gdatetime.c:957) by 0x99E97B2: g_date_time_new_local (gdatetime.c:1012) by 0x4251F4: multi_choice_changed (gcal-date-chooser.c:419) by 0x9567F16: g_cclosure_marshal_VOID__PARAM (gmarshal.c:1832) by 0x95638B9: g_closure_invoke (gclosure.c:804) by 0x957FD25: signal_emit_unlocked_R (gsignal.c:3635) by 0x957F05C: g_signal_emit_valist (gsignal.c:3391) https://bugzilla.gnome.org/show_bug.cgi?id=772272
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
f713a90ea3
commit
52a9864cba
@@ -466,6 +466,21 @@ calendar_drag_data_received (GtkWidget *widget,
|
||||
g_date_time_unref (date);
|
||||
}
|
||||
|
||||
static void
|
||||
gcal_date_chooser_finalize (GObject *object)
|
||||
{
|
||||
GcalDateChooser *self = GCAL_DATE_CHOOSER (object);
|
||||
|
||||
g_clear_pointer (&self->date, g_date_time_unref);
|
||||
G_OBJECT_CLASS (gcal_date_chooser_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gcal_date_chooser_dispose (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (gcal_date_chooser_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gcal_date_chooser_class_init (GcalDateChooserClass *class)
|
||||
{
|
||||
@@ -474,6 +489,8 @@ gcal_date_chooser_class_init (GcalDateChooserClass *class)
|
||||
|
||||
g_type_ensure (GCAL_TYPE_MULTI_CHOICE);
|
||||
|
||||
object_class->dispose = gcal_date_chooser_dispose;
|
||||
object_class->finalize = gcal_date_chooser_finalize;
|
||||
object_class->set_property = calendar_set_property;
|
||||
object_class->get_property = calendar_get_property;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user