diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | embed/downloader-view.c | 12 |
2 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,11 @@ +2007-09-08 Cosimo Cecchi <cosimoc@svn.gnome.org> + + * embed/downloader-view.c: (downloader_view_finalize), + (update_buttons_timeout_cb), (downloader_view_add_download): + + Fix runtime warnings when downloading small files, due to bad handling + of g_timeout in DownloaderView. Fixes bug #473566. + 2007-08-28 Christian Persch <chpe@gnome.org> * data/mime-types-permissions.xml: diff --git a/embed/downloader-view.c b/embed/downloader-view.c index ce4294f62..ec2575853 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -84,6 +84,7 @@ struct _DownloaderViewPrivate GtkStatusIcon *status_icon; guint idle_unref : 1; + guint source_id; }; enum @@ -289,6 +290,12 @@ downloader_view_finalize (GObject *object) g_object_unref (priv->status_icon); priv->status_icon = NULL; } + + if (priv->source_id != 0) + { + g_source_remove (priv->source_id); + priv->source_id = 0; + } g_hash_table_destroy (dv->priv->downloads_hash); @@ -496,6 +503,8 @@ static gboolean update_buttons_timeout_cb (DownloaderView *dv) { update_buttons (dv); + + dv->priv->source_id = 0; return FALSE; } @@ -568,8 +577,7 @@ downloader_view_add_download (DownloaderView *dv, g_object_unref (pixbuf); } - g_timeout_add (100, (GSourceFunc) update_buttons_timeout_cb, dv); - + dv->priv->source_id = g_timeout_add (100, (GSourceFunc) update_buttons_timeout_cb, dv); } static void |