summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2014-02-25 10:25:47 -0500
committerShaun McCance <shaunm@gnome.org>2014-02-25 10:25:47 -0500
commitb1056e5a632ad2fe28bf30c46ad07f54278f7532 (patch)
treeef767ef385d76cb3a3e9a8ef062a36086e905040
parent9c3f2e251e4b91d0f191cfe84edff99d56a5ad34 (diff)
downloadyelp-b1056e5a632ad2fe28bf30c46ad07f54278f7532.tar.gz
Don't use g_source_remove for signal handlers
This fixes reliable crashes when changing bookmarks or the read later list if any single window has been closed.
-rw-r--r--libyelp/yelp-location-entry.c10
-rw-r--r--libyelp/yelp-view.c8
-rw-r--r--src/yelp-window.c4
3 files changed, 11 insertions, 11 deletions
diff --git a/libyelp/yelp-location-entry.c b/libyelp/yelp-location-entry.c
index cb41c265..5b970a01 100644
--- a/libyelp/yelp-location-entry.c
+++ b/libyelp/yelp-location-entry.c
@@ -520,16 +520,16 @@ location_entry_dispose (GObject *object)
priv->view = NULL;
}
+ if (priv->bookmarks_changed) {
+ g_signal_handler_disconnect (priv->bookmarks, priv->bookmarks_changed);
+ priv->bookmarks_changed = 0;
+ }
+
if (priv->bookmarks) {
g_object_unref (priv->bookmarks);
priv->bookmarks = NULL;
}
- if (priv->bookmarks_changed) {
- g_source_remove (priv->bookmarks_changed);
- priv->bookmarks_changed = 0;
- }
-
if (priv->row) {
gtk_tree_row_reference_free (priv->row);
priv->row = NULL;
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index 1529137b..f27dd2e8 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -306,12 +306,12 @@ yelp_view_dispose (GObject *object)
view_clear_load (YELP_VIEW (object));
if (priv->vadjuster > 0) {
- g_source_remove (priv->vadjuster);
+ g_signal_handler_disconnect (priv->vadjustment, priv->vadjuster);
priv->vadjuster = 0;
}
if (priv->hadjuster > 0) {
- g_source_remove (priv->hadjuster);
+ g_signal_handler_disconnect (priv->hadjustment, priv->hadjuster);
priv->hadjuster = 0;
}
@@ -883,7 +883,7 @@ view_set_hadjustment (YelpView *view,
YelpViewPrivate *priv = GET_PRIV (view);
priv->hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (view));
if (priv->hadjuster > 0)
- g_source_remove (priv->hadjuster);
+ g_signal_handler_disconnect (priv->hadjustment, priv->hadjuster);
priv->hadjuster = 0;
if (priv->hadjustment)
priv->hadjuster = g_signal_connect (priv->hadjustment, "value-changed",
@@ -898,7 +898,7 @@ view_set_vadjustment (YelpView *view,
YelpViewPrivate *priv = GET_PRIV (view);
priv->vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (view));
if (priv->vadjuster > 0)
- g_source_remove (priv->vadjuster);
+ g_signal_handler_disconnect (priv->vadjustment, priv->vadjuster);
priv->vadjuster = 0;
if (priv->vadjustment)
priv->vadjuster = g_signal_connect (priv->vadjustment, "value-changed",
diff --git a/src/yelp-window.c b/src/yelp-window.c
index d36c8fee..e84e226f 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -335,12 +335,12 @@ yelp_window_dispose (GObject *object)
}
if (priv->read_later_changed) {
- g_source_remove (priv->read_later_changed);
+ g_signal_handler_disconnect (priv->application, priv->read_later_changed);
priv->read_later_changed = 0;
}
if (priv->bookmarks_changed) {
- g_source_remove (priv->bookmarks_changed);
+ g_signal_handler_disconnect (priv->application, priv->bookmarks_changed);
priv->bookmarks_changed = 0;
}