fixed some memory leak issues

This commit is contained in:
hyung-hwan 2023-11-16 01:45:52 +09:00
parent faebe1d043
commit 0d44a00953
4 changed files with 18 additions and 1 deletions

View File

@ -173,6 +173,15 @@ void hio_fini (hio_t* hio)
}
}
/* clean up unfired cwq entries - calling fire_cwq_handlers() might not be good here. */
while (!HIO_CWQ_IS_EMPTY(&hio->cwq))
{
hio_cwq_t* cwq;
cwq = HIO_CWQ_HEAD(&hio->cwq);
HIO_CWQ_UNLINK (cwq);
hio_freemem (hio, cwq);
}
/* kill services before killing devices */
while (!HIO_SVCL_IS_EMPTY(&hio->actsvc))
{

View File

@ -865,6 +865,10 @@ static void unbind_task_from_peer (cgi_t* cgi, int rcdown)
if (cgi->peer)
{
cgi_peer_xtn_t* peer_xtn;
peer_xtn = hio_dev_pro_getxtn(cgi->peer);
peer_xtn->cgi = HIO_NULL;
hio_dev_pro_kill (cgi->peer);
cgi->peer = HIO_NULL;
n++;

View File

@ -697,7 +697,7 @@ static void unbind_task_from_peer (fcgi_t* fcgi, int rcdown)
if (fcgi->peer)
{
/* hio-svc_fcgic_untie() is not a delayed operation unlike hio_dev_sck_halt().
/* hio_svc_fcgic_untie() is not a delayed operation unlike hio_dev_sck_halt().
* TODO: check if this is a buggy idea */
hio_svc_fcgic_untie (fcgi->peer);
fcgi->peer = HIO_NULL;

View File

@ -862,6 +862,10 @@ static void unbind_task_from_peer (prxy_t* prxy, int rcdown)
if (prxy->peer)
{
prxy_peer_xtn_t* peer_xtn;
peer_xtn = hio_dev_pro_getxtn(prxy->peer);
peer_xtn->prxy = HIO_NULL;
hio_dev_pro_kill (prxy->peer);
prxy->peer = HIO_NULL;
n++;