temporarily reference connection while calling disconnect callback, so that it's safe for the callback to unref the connection
--- a/loudmouth/lm-connection.c Tue Oct 02 14:11:04 2007 +0200
+++ b/loudmouth/lm-connection.c Fri Oct 19 16:57:31 2007 +0100
@@ -736,9 +736,11 @@
if (connection->disconnect_cb && connection->disconnect_cb->func) {
LmCallback *cb = connection->disconnect_cb;
+ lm_connection_ref (connection);
(* ((LmDisconnectFunction) cb->func)) (connection,
reason,
cb->user_data);
+ lm_connection_unref (connection);
}
}