aboutsummaryrefslogtreecommitdiffstats
path: root/embed/downloader-view.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@svn.gnome.org>2007-09-08 07:33:54 +0800
committerCosimo Cecchi <cosimoc@src.gnome.org>2007-09-08 07:33:54 +0800
commit753299c1380ba2feb4866c4079c4d48b033887b1 (patch)
treef479cf57e6a50d5bc66f2c0a16302952a3586262 /embed/downloader-view.c
parente8faacfe408e53b529f11b826cd3d60a94fb7041 (diff)
downloadgsoc2013-epiphany-753299c1380ba2feb4866c4079c4d48b033887b1.tar
gsoc2013-epiphany-753299c1380ba2feb4866c4079c4d48b033887b1.tar.gz
gsoc2013-epiphany-753299c1380ba2feb4866c4079c4d48b033887b1.tar.bz2
gsoc2013-epiphany-753299c1380ba2feb4866c4079c4d48b033887b1.tar.lz
gsoc2013-epiphany-753299c1380ba2feb4866c4079c4d48b033887b1.tar.xz
gsoc2013-epiphany-753299c1380ba2feb4866c4079c4d48b033887b1.tar.zst
gsoc2013-epiphany-753299c1380ba2feb4866c4079c4d48b033887b1.zip
Fix runtime warnings when downloading small files, due to bad handling of
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. svn path=/trunk/; revision=7351
Diffstat (limited to 'embed/downloader-view.c')
-rw-r--r--embed/downloader-view.c12
1 files changed, 10 insertions, 2 deletions
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