未验证 提交 3677f929 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #8178 from taosdata/hotfix/TD-10565

fix cq crash issue
......@@ -752,7 +752,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p
void taos_close_stream(TAOS_STREAM *handle) {
SSqlStream *pStream = (SSqlStream *)handle;
SSqlObj *pSql = (SSqlObj *)atomic_exchange_ptr(&pStream->pSql, 0);
SSqlObj *pSql = pStream->pSql;
if (pSql == NULL) {
return;
}
......@@ -763,13 +763,13 @@ void taos_close_stream(TAOS_STREAM *handle) {
*/
if (pSql->signature == pSql) {
tscRemoveFromStreamList(pStream, pSql);
pStream->pSql = NULL;
taosTmrStopA(&(pStream->pTimer));
tscDebug("0x%"PRIx64" stream:%p is closed", pSql->self, pStream);
// notify CQ to release the pStream object
pStream->fp(pStream->param, NULL, NULL);
pStream->pSql = NULL;
taos_free_result(pSql);
tfree(pStream);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册