aboutsummaryrefslogtreecommitdiffstats
path: root/embed/downloader-view.c
diff options
context:
space:
mode:
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