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

Jérôme Guelfucci noreply at xfce.org
Fri Mar 18 18:06:03 CET 2011


Updating branch refs/heads/webkit-thumbnailer
         to 74245acb808131c305e5d9f3c0560634e7e93a8a (commit)
       from d53c2e94afa15fafac87f38e3187076287010cae (commit)

commit 74245acb808131c305e5d9f3c0560634e7e93a8a
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