conn: disconnect if user destroys an active connection object
Backported from UnrealEngine project.
This commit is contained in:
@@ -254,6 +254,12 @@ int xmpp_conn_release(xmpp_conn_t * const conn)
|
||||
else {
|
||||
ctx = conn->ctx;
|
||||
|
||||
if (conn->state == XMPP_STATE_CONNECTING ||
|
||||
conn->state == XMPP_STATE_CONNECTED)
|
||||
{
|
||||
conn_disconnect(conn);
|
||||
}
|
||||
|
||||
/* remove connection from context's connlist */
|
||||
if (ctx->connlist->conn == conn) {
|
||||
item = ctx->connlist;
|
||||
|
||||
Reference in New Issue
Block a user