[yelp] [libyelp/yelp-view] Manage and disconnect GtkAdjustment signal handlers
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] [libyelp/yelp-view] Manage and disconnect GtkAdjustment signal handlers
- Date: Tue, 18 May 2010 14:39:43 +0000 (UTC)
commit e2482e393bda8213b0af8c693e32045b1418b9b1
Author: Shaun McCance <shaunm gnome org>
Date: Tue May 18 09:38:47 2010 -0500
[libyelp/yelp-view] Manage and disconnect GtkAdjustment signal handlers
libyelp/yelp-view.c | 26 ++++++++++++++++++++++----
1 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index 89eb36b..01ec1b9 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -184,6 +184,8 @@ struct _YelpViewPrivate {
GtkAdjustment *hadjustment;
gdouble vadjust;
gdouble hadjust;
+ gulong vadjuster;
+ gulong hadjuster;
gchar *popup_link_uri;
@@ -247,6 +249,16 @@ yelp_view_dispose (GObject *object)
priv->uri = NULL;
}
+ if (priv->vadjuster > 0) {
+ g_source_remove (priv->vadjuster);
+ priv->vadjuster = 0;
+ }
+
+ if (priv->hadjuster > 0) {
+ g_source_remove (priv->hadjuster);
+ priv->hadjuster = 0;
+ }
+
if (priv->cancellable) {
g_cancellable_cancel (priv->cancellable);
g_object_unref (priv->cancellable);
@@ -603,14 +615,20 @@ view_scroll_adjustments (YelpView *view,
{
YelpViewPrivate *priv = GET_PRIV (view);
priv->vadjustment = vadj;
+ if (priv->vadjuster > 0)
+ g_source_remove (priv->vadjuster);
+ priv->vadjuster = 0;
if (vadj) {
- g_signal_connect (vadj, "value-changed",
- G_CALLBACK (view_scrolled), view);
+ priv->vadjuster = g_signal_connect (vadj, "value-changed",
+ G_CALLBACK (view_scrolled), view);
}
priv->hadjustment = hadj;
+ if (priv->hadjuster > 0)
+ g_source_remove (priv->hadjuster);
+ priv->hadjuster = 0;
if (hadj) {
- g_signal_connect (hadj, "value-changed",
- G_CALLBACK (view_scrolled), view);
+ priv->hadjuster = g_signal_connect (hadj, "value-changed",
+ G_CALLBACK (view_scrolled), view);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]