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

Jérôme Guelfucci noreply at xfce.org
Sun Feb 24 14:42:04 CET 2013


Updating branch refs/heads/jeromeg/webkit-thumbnailer-rebased
         to 4f7cd26ac7fc05bef9d6415c007838ec792f4426 (commit)
       from 21c1b6adb67b629967c3e8b536075e3e3e40b8c3 (commit)

commit 4f7cd26ac7fc05bef9d6415c007838ec792f4426
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