/pidgin/main: 4bb64c5ef111: Ensure queue processing function is ...

Elliott Sales de Andrade qulogic at pidgin.im
Mon Aug 6 03:42:20 EDT 2012


Changeset: 4bb64c5ef111c8dd1e2355dafac47da68f2517b1
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2012-08-04 02:52 -0400
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/4bb64c5ef111

Description:

Ensure queue processing function is only added once.

diffstat:

 pidgin/gtkwebview.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (25 lines):

diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c
--- a/pidgin/gtkwebview.c
+++ b/pidgin/gtkwebview.c
@@ -580,8 +580,8 @@ gtk_webview_safe_execute_script(GtkWebVi
 	priv = GTK_WEBVIEW_GET_PRIVATE(webview);
 	g_queue_push_tail(priv->load_queue, GINT_TO_POINTER(LOAD_JS));
 	g_queue_push_tail(priv->load_queue, g_strdup(script));
-	if (!priv->is_loading)
-		g_idle_add((GSourceFunc)process_load_queue, webview);
+	if (!priv->is_loading && priv->loader == 0)
+		priv->loader = g_idle_add((GSourceFunc)process_load_queue, webview);
 }
 
 void
@@ -622,8 +622,8 @@ gtk_webview_append_html(GtkWebView *webv
 	priv = GTK_WEBVIEW_GET_PRIVATE(webview);
 	g_queue_push_tail(priv->load_queue, GINT_TO_POINTER(LOAD_HTML));
 	g_queue_push_tail(priv->load_queue, g_strdup(html));
-	if (!priv->is_loading)
-		g_idle_add((GSourceFunc)process_load_queue, webview);
+	if (!priv->is_loading && priv->loader == 0)
+		priv->loader = g_idle_add((GSourceFunc)process_load_queue, webview);
 }
 
 void



More information about the Commits mailing list