Commit 9ae6d092 authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte Committed by Daniel Boles
Browse files

a11y/ScrolledWin|IconView: Connect signals safely

Use g_signal_connect_data() instead of g_signal_connect_object()
to make sure the callback gets disconnected when the data object
is destroyed. This avoids problems in garbage-collected bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=789215
parent 21fddc39
......@@ -1226,18 +1226,18 @@ gtk_icon_view_accessible_connect_model_signals (GtkIconView *icon_view)
GObject *obj;
obj = G_OBJECT (icon_view->priv->model);
g_signal_connect_data (obj, "row-changed",
(GCallback) gtk_icon_view_accessible_model_row_changed,
icon_view, NULL, 0);
g_signal_connect_data (obj, "row-inserted",
(GCallback) gtk_icon_view_accessible_model_row_inserted,
icon_view, NULL, G_CONNECT_AFTER);
g_signal_connect_data (obj, "row-deleted",
(GCallback) gtk_icon_view_accessible_model_row_deleted,
icon_view, NULL, G_CONNECT_AFTER);
g_signal_connect_data (obj, "rows-reordered",
(GCallback) gtk_icon_view_accessible_model_rows_reordered,
icon_view, NULL, G_CONNECT_AFTER);
g_signal_connect_object (obj, "row-changed",
G_CALLBACK (gtk_icon_view_accessible_model_row_changed),
icon_view, 0);
g_signal_connect_object (obj, "row-inserted",
G_CALLBACK (gtk_icon_view_accessible_model_row_inserted),
icon_view, G_CONNECT_AFTER);
g_signal_connect_object (obj, "row-deleted",
G_CALLBACK (gtk_icon_view_accessible_model_row_deleted),
icon_view, G_CONNECT_AFTER);
g_signal_connect_object (obj, "rows-reordered",
G_CALLBACK (gtk_icon_view_accessible_model_rows_reordered),
icon_view, G_CONNECT_AFTER);
}
static void
......
......@@ -92,12 +92,12 @@ gtk_scrolled_window_accessible_initialize (AtkObject *obj,
window = GTK_SCROLLED_WINDOW (data);
g_signal_connect_data (gtk_scrolled_window_get_hscrollbar (window), "notify::visible",
G_CALLBACK (visibility_changed),
obj, NULL, FALSE);
g_signal_connect_data (gtk_scrolled_window_get_vscrollbar (window), "notify::visible",
G_CALLBACK (visibility_changed),
obj, NULL, FALSE);
g_signal_connect_object (gtk_scrolled_window_get_hscrollbar (window), "notify::visible",
G_CALLBACK (visibility_changed),
obj, 0);
g_signal_connect_object (gtk_scrolled_window_get_vscrollbar (window), "notify::visible",
G_CALLBACK (visibility_changed),
obj, 0);
obj->role = ATK_ROLE_SCROLL_PANE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment