From db4b0c198b6b338dfb447a3321c8033488134b1c Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Wed, 5 Sep 2012 22:20:02 +0200 Subject: Added a check in trg_update_torrents_timerfunc to make sure that the TrgMainWindow* object passed as data has not been freed. --- src/trg-main-window.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/trg-main-window.c') diff --git a/src/trg-main-window.c b/src/trg-main-window.c index 28b91a0..914d061 100644 --- a/src/trg-main-window.c +++ b/src/trg-main-window.c @@ -1357,6 +1357,11 @@ static gboolean trg_session_update_timerfunc(gpointer data) static gboolean trg_update_torrents_timerfunc(gpointer data) { + /* Check if the TrgMainWindow* has already been destroyed + * and, in that case, stop polling the server. */ + if (!TRG_IS_MAIN_WINDOW (data)) + return FALSE; + TrgMainWindow *win = TRG_MAIN_WINDOW(data); TrgMainWindowPrivate *priv = win->priv; TrgClient *tc = priv->client; -- cgit v1.2.3