OCT 1.修正接口内存泄漏
This commit is contained in:
parent
c303960261
commit
32fec2621b
|
@ -798,8 +798,11 @@ void iptvCacheCb(void *UNUSED(pArg)) {
|
||||||
// 新发现设备没有被上报过
|
// 新发现设备没有被上报过
|
||||||
if (!pTemp) {
|
if (!pTemp) {
|
||||||
auto pCacheDev = (PIPTV_DEV_SET)malloc(sizeof(IPTV_DEV_SET));
|
auto pCacheDev = (PIPTV_DEV_SET)malloc(sizeof(IPTV_DEV_SET));
|
||||||
|
auto pRepDev = (PIPTV_DEV_SET)malloc(sizeof(IPTV_DEV_SET));
|
||||||
|
|
||||||
memcpy(pCacheDev, pDev, sizeof(IPTV_DEV_SET));
|
memcpy(pCacheDev, pDev, sizeof(IPTV_DEV_SET));
|
||||||
HASH_ADD_STR(report, iptvMAC, pCacheDev);
|
memcpy(pRepDev, pDev, sizeof(IPTV_DEV_SET));
|
||||||
|
HASH_ADD_STR(report, iptvMAC, pRepDev);
|
||||||
|
|
||||||
isReport = true;
|
isReport = true;
|
||||||
// 添加到缓存列表供后续查询
|
// 添加到缓存列表供后续查询
|
||||||
|
@ -836,6 +839,11 @@ void iptvCacheCb(void *UNUSED(pArg)) {
|
||||||
inet_http_post_async(pUrl, pStrPro, on_http_response_cb, (void *)pStrPro);
|
inet_http_post_async(pUrl, pStrPro, on_http_response_cb, (void *)pStrPro);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HASH_ITER(hh, report, pDev, pTmp) {
|
||||||
|
HASH_DEL(report, pDev);
|
||||||
|
free(pDev);
|
||||||
|
}
|
||||||
|
|
||||||
uv_sleep(10);
|
uv_sleep(10);
|
||||||
} while (true);
|
} while (true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue