Use more g_signal_connect_object()

Most of these are probably paranoid, not bugs. I haven't done an
exhaustive review to see what really needs it: that would be
time-consuming and require significant familiarity with the Calendar
codebase. This was just a quick check. Anyway, I vote for paranoid
when it comes to using g_signal_connect() regardless. It's dangerous,
and there's no reason to ever leave a signal connected after the user
data object has been destroyed.

Fixes #423
This commit is contained in:
Michael Catanzaro
2019-09-14 23:28:42 +00:00
committed by Georges Basile Stavracas Neto
parent 9644c30eee
commit 18ae67cb59
15 changed files with 87 additions and 74 deletions
+4 -4
View File
@@ -188,8 +188,8 @@ setup_child_widget (GcalMonthView *self,
if (!gtk_widget_get_parent (widget))
gtk_widget_set_parent (widget, GTK_WIDGET (self));
g_signal_connect (widget, "activate", G_CALLBACK (on_event_activated_cb), self);
g_signal_connect (widget, "notify::visible", G_CALLBACK (on_event_widget_visibility_changed_cb), self);
g_signal_connect_object (widget, "activate", G_CALLBACK (on_event_activated_cb), self, 0);
g_signal_connect_object (widget, "notify::visible", G_CALLBACK (on_event_widget_visibility_changed_cb), self, 0);
}
static gboolean
@@ -861,7 +861,7 @@ setup_month_grid (GcalMonthView *self,
cell = gcal_month_cell_new ();
g_signal_connect (cell, "show-overflow", G_CALLBACK (on_month_cell_show_overflow_popover_cb), self);
g_signal_connect_object (cell, "show-overflow", G_CALLBACK (on_month_cell_show_overflow_popover_cb), self, 0);
self->month_cell[row][col] = cell;
@@ -2343,6 +2343,6 @@ gcal_month_view_init (GcalMonthView *self)
"context",
G_BINDING_DEFAULT);
g_signal_connect (self->overflow_popover, "event-activated", G_CALLBACK (on_month_popover_event_activated_cb), self);
g_signal_connect_object (self->overflow_popover, "event-activated", G_CALLBACK (on_month_popover_event_activated_cb), self, 0);
}