diff options
author | Leonardo Robol <leo@robol.it> | 2012-09-05 22:20:02 +0200 |
---|---|---|
committer | Leonardo Robol <leo@robol.it> | 2012-09-05 22:20:02 +0200 |
commit | db4b0c198b6b338dfb447a3321c8033488134b1c (patch) | |
tree | 4815b97d2e21dacf2b69d5bf19068bfb8c3c721e /src/trg-main-window.c | |
parent | 6cd5bf14b8ea237ebddd48fea9819efa517ddaaf (diff) |
Added a check in trg_update_torrents_timerfunc to make sure
that the TrgMainWindow* object passed as data has not been freed.
Diffstat (limited to 'src/trg-main-window.c')
-rw-r--r-- | src/trg-main-window.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |