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 {
|
else {
|
||||||
ctx = conn->ctx;
|
ctx = conn->ctx;
|
||||||
|
|
||||||
|
if (conn->state == XMPP_STATE_CONNECTING ||
|
||||||
|
conn->state == XMPP_STATE_CONNECTED)
|
||||||
|
{
|
||||||
|
conn_disconnect(conn);
|
||||||
|
}
|
||||||
|
|
||||||
/* remove connection from context's connlist */
|
/* remove connection from context's connlist */
|
||||||
if (ctx->connlist->conn == conn) {
|
if (ctx->connlist->conn == conn) {
|
||||||
item = ctx->connlist;
|
item = ctx->connlist;
|
||||||
|
|||||||
Reference in New Issue
Block a user