Commit 6f8adeb0 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Avoid a segfault when removing packages

GsAppWidget must use g_signal_connect_object to connect to
app signals, since the app can outlive the widget.
parent ecdab962
......@@ -185,15 +185,6 @@ gs_app_widget_get_app (GsAppWidget *app_widget)
* gs_app_widget_app_state_changed_cb:
static void
gs_app_widget_app_state_changed_cb (GsApp *app, GsAppWidget *app_widget)
gs_app_widget_refresh (app_widget);
* gs_app_widget_set_app:
......@@ -203,9 +194,9 @@ gs_app_widget_set_app (GsAppWidget *app_widget, GsApp *app)
g_return_if_fail (GS_IS_APP_WIDGET (app_widget));
g_return_if_fail (GS_IS_APP (app));
app_widget->priv->app = g_object_ref (app);
g_signal_connect (app_widget->priv->app, "state-changed",
G_CALLBACK (gs_app_widget_app_state_changed_cb),
g_signal_connect_object (app_widget->priv->app, "state-changed",
G_CALLBACK (gs_app_widget_refresh),
app_widget, G_CONNECT_SWAPPED);
gs_app_widget_refresh (app_widget);
Supports Markdown
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