window: remove source when finalizing

Sometimes we crash the window right after closing it
because we set a timeout for save_geometry() before
destroying it, and the timeout is called after the
window is destroyed.
This commit is contained in:
Georges Basile Stavracas Neto
2016-02-14 12:17:37 -02:00
parent 34ff93ce3f
commit a5658e3993
+6
View File
@@ -1506,6 +1506,12 @@ gcal_window_finalize (GObject *object)
{
GcalWindow *window = GCAL_WINDOW (object);
if (window->save_geometry_timeout_id > 0)
{
g_source_remove (window->save_geometry_timeout_id);
window->save_geometry_timeout_id = 0;
}
g_clear_object (&window->manager);
g_clear_object (&window->views_switcher);