window: use g_clear_pointer instead of g_date_time_unref

This would handle the case where the datetime is NULL for us.
This commit is contained in:
Georges Basile Stavracas Neto
2016-02-28 14:13:19 -03:00
parent 9549b20578
commit af6f2141ab
+2 -2
View File
@@ -667,8 +667,8 @@ show_new_event_widget (GcalView *view,
if (window->event_creation_data != NULL)
{
g_date_time_unref (window->event_creation_data->start_date);
g_date_time_unref (window->event_creation_data->end_date);
g_clear_pointer (&window->event_creation_data->start_date, g_date_time_unref);
g_clear_pointer (&window->event_creation_data->end_date, g_date_time_unref);
g_free (window->event_creation_data);
}