提交 d73c7a80 编写于 作者: A Alex Duan

fix(client): pSql->subStates maybe can be free fixed

上级 c386f41d
......@@ -284,6 +284,17 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
pthread_mutex_lock(&pSql->subState.mutex);
if (pSql->pSubs != NULL && pSql->subState.states != NULL) {
for (int32_t i = 0; i < pQdesc->numOfSub; ++i) {
// because subState maybe free on anytime by any thread, check validate from here
if(pSql->subState.numOfSub != pQdesc->numOfSub ||
pSql->pSubs == NULL ||
pSql->subState.states == NULL) {
tscError(" QUERY-HEART STscObj=%p subState maybe free. numOfSub=%d pSubs=%p states=%p",
pObj, pSql->subState.numOfSub, pSql->pSubs, pSql->subState.states);
pQdesc->numOfSub = 0;
// break for
break;
}
SSqlObj *psub = pSql->pSubs[i];
int64_t self = (psub != NULL)? psub->self : 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册