diff options
author | Don Scorgie <dscorgie@src.gnome.org> | 2006-03-21 18:09:44 +0000 |
---|---|---|
committer | Don Scorgie <dscorgie@src.gnome.org> | 2006-03-21 18:09:44 +0000 |
commit | f75c478bf6e45064d4b7d523184bd6ef14a9adc2 (patch) | |
tree | a1d9f51fc84a2e02142e573738074491a887f326 | |
parent | 6a305a8eb48ace0c24f95b6f454613f9417fd9c7 (diff) | |
download | yelp-f75c478bf6e45064d4b7d523184bd6ef14a9adc2.tar.gz |
src/yelp-html.cpp: Keep track of timeout and remove when not needed Fixes
src/yelp-html.cpp:
Keep track of timeout and remove when not needed
Fixes bug #335306
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/yelp-html.cpp | 10 |
2 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2006-03-21 Don Scorgie <dscorgie@cvs.gnome.org> + + * src/yelp-html.cpp: + Keep track of timeout and remove when not needed + Fixes bug #335306 + 2006-03-16 Jérémy Ar Floc'h <jeremy.lefloch@gmail.com> * configure.in: Added Breton translation. diff --git a/src/yelp-html.cpp b/src/yelp-html.cpp index c6a2ec47..780e1f97 100644 --- a/src/yelp-html.cpp +++ b/src/yelp-html.cpp @@ -50,6 +50,7 @@ struct _YelpHtmlPriv { gchar *base_uri; gchar *anchor; gboolean frames_enabled; + guint timeout; }; static void html_set_fonts (void); @@ -138,6 +139,7 @@ html_init (YelpHtml *html) priv->base_uri = NULL; priv->anchor = NULL; + priv->timeout = 0; priv->yelper = new Yelper (GTK_MOZ_EMBED (html)); klass = YELP_HTML_GET_CLASS (html); @@ -183,6 +185,8 @@ html_finalize (GObject *object) delete priv->yelper; + if (priv->timeout) + g_source_remove (priv->timeout); g_free (priv->base_uri); g_free (priv->anchor); @@ -369,6 +373,7 @@ timeout_update_gok (YelpHtml *html) { g_signal_emit_by_name (gtk_widget_get_accessible (GTK_WIDGET (html)), "children_changed::add", -1, NULL, NULL); + html->priv->timeout = 0; return FALSE; } @@ -377,8 +382,9 @@ yelp_html_close (YelpHtml *html) { d (g_print ("yelp_html_close\n")); gtk_moz_embed_close_stream (GTK_MOZ_EMBED (html)); - g_timeout_add (2000, (GSourceFunc) timeout_update_gok, - html); + html->priv->timeout = g_timeout_add (2000, + (GSourceFunc) timeout_update_gok, + html); } gboolean |