Free send queue on connection release
This commit is contained in:
committed by
Dmitry Podgorny
parent
a7c18ba6c7
commit
714b2f9c03
10
src/conn.c
10
src/conn.c
@@ -187,6 +187,7 @@ xmpp_conn_t *xmpp_conn_clone(xmpp_conn_t * const conn)
|
|||||||
int xmpp_conn_release(xmpp_conn_t * const conn)
|
int xmpp_conn_release(xmpp_conn_t * const conn)
|
||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
|
xmpp_send_queue_t *sq, *tsq;
|
||||||
xmpp_connlist_t *item, *prev;
|
xmpp_connlist_t *item, *prev;
|
||||||
xmpp_handlist_t *hlitem, *thli;
|
xmpp_handlist_t *hlitem, *thli;
|
||||||
hash_iterator_t *iter;
|
hash_iterator_t *iter;
|
||||||
@@ -268,6 +269,15 @@ int xmpp_conn_release(xmpp_conn_t * const conn)
|
|||||||
|
|
||||||
parser_free(conn->parser);
|
parser_free(conn->parser);
|
||||||
|
|
||||||
|
/* free queued */
|
||||||
|
sq = conn->send_queue_head;
|
||||||
|
while (sq) {
|
||||||
|
tsq = sq;
|
||||||
|
sq = sq->next;
|
||||||
|
xmpp_free(ctx, tsq->data);
|
||||||
|
xmpp_free(ctx, tsq);
|
||||||
|
}
|
||||||
|
|
||||||
if (conn->domain) xmpp_free(ctx, conn->domain);
|
if (conn->domain) xmpp_free(ctx, conn->domain);
|
||||||
if (conn->jid) xmpp_free(ctx, conn->jid);
|
if (conn->jid) xmpp_free(ctx, conn->jid);
|
||||||
if (conn->bound_jid) xmpp_free(ctx, conn->bound_jid);
|
if (conn->bound_jid) xmpp_free(ctx, conn->bound_jid);
|
||||||
|
|||||||
Reference in New Issue
Block a user