[Xfce4-commits] <tumbler:jeromeg/webkit-thumbnailer> Remove the timeout callback when done.

Jannis Pohlmann noreply at xfce.org
Thu May 26 16:06:07 CEST 2011


Updating branch refs/heads/jeromeg/webkit-thumbnailer
         to 234059bb7b061dbc6d74f7444b04dcbf6fe5a57a (commit)
       from 54e2e051fc3c1f34bb9f32d6836c17407d89bdd6 (commit)

commit 234059bb7b061dbc6d74f7444b04dcbf6fe5a57a
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Fri Mar 18 18:04:12 2011 +0100

    Remove the timeout callback when done.
    
    It triggers warnings otherwise, because the main loop does not exist
    anymore when the thumbnailing is successful.

 plugins/webkit-thumbnailer/webkit-thumbnailer.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/plugins/webkit-thumbnailer/webkit-thumbnailer.c b/plugins/webkit-thumbnailer/webkit-thumbnailer.c
index 79633ed..d3b7e78 100644
--- a/plugins/webkit-thumbnailer/webkit-thumbnailer.c
+++ b/plugins/webkit-thumbnailer/webkit-thumbnailer.c
@@ -226,6 +226,7 @@ webkit_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer,
   TumblerThumbnail       *thumbnail;
   TumblerImageData        data;
   GError                 *error = NULL;
+  guint                   timeout_id;
   gint                    dest_width;
   gint                    dest_height;
   const gchar            *uri;
@@ -251,7 +252,8 @@ webkit_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer,
   uri = tumbler_file_info_get_uri (info);
 
   /* schedule a timeout to avoid waiting forever */
-  g_timeout_add_seconds (LOAD_TIMEOUT, cb_load_timeout, NULL);
+  timeout_id =
+    g_timeout_add_seconds (LOAD_TIMEOUT, cb_load_timeout, NULL);
 
   /* load the page in the web view */
   webkit_web_view_load_uri (WEBKIT_WEB_VIEW (webkit_thumbnailer->view),
@@ -260,6 +262,9 @@ webkit_thumbnailer_create (TumblerAbstractThumbnailer *thumbnailer,
   /* wait until the page is loaded */
   gtk_main ();
 
+  /* remove the timeout */
+  g_source_remove (timeout_id);
+
   if (webkit_thumbnailer->tmp == NULL)
     {
       /* emit an error signal */



More information about the Xfce4-commits mailing list