notifications: Use g_signal_connect_object to ensure handlers are not run after object destroyed
Fixes specific crash: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/75
This commit is contained in:
parent
556388f373
commit
b3ea72735a
1 changed files with 7 additions and 6 deletions
|
@ -203,7 +203,7 @@ cc_notifications_panel_init (CcNotificationsPanel *panel)
|
||||||
"ccnotify-switch-listbox"));
|
"ccnotify-switch-listbox"));
|
||||||
panel->sections = g_list_append (panel->sections, w);
|
panel->sections = g_list_append (panel->sections, w);
|
||||||
panel->sections_reverse = g_list_prepend (panel->sections_reverse, w);
|
panel->sections_reverse = g_list_prepend (panel->sections_reverse, w);
|
||||||
g_signal_connect (w, "keynav-failed", G_CALLBACK (keynav_failed), panel);
|
g_signal_connect_object (w, "keynav-failed", G_CALLBACK (keynav_failed), panel, 0);
|
||||||
gtk_list_box_set_header_func (GTK_LIST_BOX (w),
|
gtk_list_box_set_header_func (GTK_LIST_BOX (w),
|
||||||
cc_list_box_update_header_func,
|
cc_list_box_update_header_func,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
@ -221,14 +221,14 @@ cc_notifications_panel_init (CcNotificationsPanel *panel)
|
||||||
|
|
||||||
panel->sections = g_list_append (panel->sections, w);
|
panel->sections = g_list_append (panel->sections, w);
|
||||||
panel->sections_reverse = g_list_prepend (panel->sections_reverse, w);
|
panel->sections_reverse = g_list_prepend (panel->sections_reverse, w);
|
||||||
g_signal_connect (w, "keynav-failed", G_CALLBACK (keynav_failed), panel);
|
g_signal_connect_object (w, "keynav-failed", G_CALLBACK (keynav_failed), panel, 0);
|
||||||
gtk_list_box_set_sort_func (GTK_LIST_BOX (w), (GtkListBoxSortFunc)sort_apps, NULL, NULL);
|
gtk_list_box_set_sort_func (GTK_LIST_BOX (w), (GtkListBoxSortFunc)sort_apps, NULL, NULL);
|
||||||
gtk_list_box_set_header_func (GTK_LIST_BOX (w),
|
gtk_list_box_set_header_func (GTK_LIST_BOX (w),
|
||||||
cc_list_box_update_header_func,
|
cc_list_box_update_header_func,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
g_signal_connect (GTK_LIST_BOX (w), "row-activated",
|
g_signal_connect_object (GTK_LIST_BOX (w), "row-activated",
|
||||||
G_CALLBACK (select_app), panel);
|
G_CALLBACK (select_app), panel, 0);
|
||||||
|
|
||||||
build_app_store (panel);
|
build_app_store (panel);
|
||||||
|
|
||||||
|
@ -543,8 +543,9 @@ build_app_store (CcNotificationsPanel *panel)
|
||||||
{
|
{
|
||||||
/* Build application entries for known applications */
|
/* Build application entries for known applications */
|
||||||
children_changed (panel->master_settings, NULL, panel);
|
children_changed (panel->master_settings, NULL, panel);
|
||||||
g_signal_connect (panel->master_settings, "changed::application-children",
|
g_signal_connect_object (panel->master_settings,
|
||||||
G_CALLBACK (children_changed), panel);
|
"changed::application-children",
|
||||||
|
G_CALLBACK (children_changed), panel, 0);
|
||||||
|
|
||||||
/* Scan applications that statically declare to show notifications */
|
/* Scan applications that statically declare to show notifications */
|
||||||
load_apps_async (panel);
|
load_apps_async (panel);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue