[gnome-software] feature tile: Disconnect app signal handlers
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] feature tile: Disconnect app signal handlers
- Date: Thu, 11 Sep 2014 16:21:07 +0000 (UTC)
commit 0d1bf106b49f5dc2315351e0f9f9fd04f82ec5b2
Author: Kalev Lember <kalevlember gmail com>
Date: Thu Sep 11 18:17:22 2014 +0200
feature tile: Disconnect app signal handlers
Otherwise the app might outlive the tile and call back to the tile after
it's been destroyed.
src/gs-feature-tile.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index 6636071..dba10f6 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -99,6 +99,9 @@ gs_feature_tile_set_app (GsFeatureTile *tile, GsApp *app)
priv = gs_feature_tile_get_instance_private (tile);
+ if (priv->app)
+ g_signal_handlers_disconnect_by_func (priv->app, app_state_changed, tile);
+
g_clear_object (&priv->app);
if (!app)
return;
@@ -160,6 +163,9 @@ gs_feature_tile_destroy (GtkWidget *widget)
priv = gs_feature_tile_get_instance_private (tile);
+ if (priv->app)
+ g_signal_handlers_disconnect_by_func (priv->app, app_state_changed, tile);
+
g_clear_object (&priv->app);
g_clear_object (&priv->provider);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]