moved conn_destroy to conn.c

This commit is contained in:
2022-08-14 14:15:18 +02:00
parent 85f79eac6a
commit 5f16ed5455
3 changed files with 22 additions and 45 deletions

View File

@ -938,3 +938,24 @@ int cw_read_messages(struct cw_Conn *conn)
errno = EAGAIN;
return -1;
}
/**
* Destroy a conn object
* @param object to destroy
*/
void conn_destroy(struct cw_Conn * conn)
{
if (conn->fragman)
fragman_destroy(conn->fragman);
if (conn->q)
free (conn->q);
if (conn->msg_callbacks)
mavl_destroy(conn->msg_callbacks);
free(conn);
}