# HG changeset patch # User Nathan Walp # Date 1060180438 0 # Node ID 74ca311ceb2a8027abde324decb86b9b4d7090f6 # Parent e9974608b319b96cccff71b90ed5ab9e1ce7747e [gaim-migrate @ 6898] This manages to not make jabber (and maybe others) not crash on connection errors and stuff. committer: Tailor Script diff -r e9974608b319 -r 74ca311ceb2a src/connection.c --- a/src/connection.c Wed Aug 06 11:38:57 2003 +0000 +++ b/src/connection.c Wed Aug 06 14:33:58 2003 +0000 @@ -82,6 +82,9 @@ if (gc->away_state != NULL) g_free(gc->away_state); + if (gc->disconnect_timeout) + g_source_remove(gc->disconnect_timeout); + g_free(gc); } @@ -401,6 +404,10 @@ g_return_if_fail(gc != NULL); g_return_if_fail(text != NULL); + /* If we've already got one error, we don't need any more */ + if(gc->disconnect_timeout) + return; + primary = g_strdup_printf(_("%s has been disconnected"), gaim_account_get_username(gaim_connection_get_account(gc))); secondary = g_strdup_printf("%s\n%s", full_date(), @@ -414,7 +421,7 @@ if (ops != NULL && ops->disconnected != NULL) ops->disconnected(gc, text); - g_timeout_add(0, gaim_connection_disconnect_cb, + gc->disconnect_timeout = g_timeout_add(0, gaim_connection_disconnect_cb, gaim_connection_get_account(gc)); } diff -r e9974608b319 -r 74ca311ceb2a src/connection.h --- a/src/connection.h Wed Aug 06 11:38:57 2003 +0000 +++ b/src/connection.h Wed Aug 06 14:33:58 2003 +0000 @@ -83,6 +83,7 @@ this here?) */ gboolean wants_to_die; /**< Wants to Die state. */ + guint disconnect_timeout; /**< Timer used for nasty stack tricks */ }; #ifdef __cplusplus