提交 fbb76bb9 编写于 作者: H Haojun Liao

[td-1319]

上级 7d56810a
......@@ -265,22 +265,22 @@ void taos_close(TAOS *taos) {
}
// free all sqlObjs created by using this connect before free the STscObj
while(1) {
pthread_mutex_lock(&pObj->mutex);
void* p = pObj->sqlList;
pthread_mutex_unlock(&pObj->mutex);
if (p == NULL) {
break;
}
tscDebug("%p waiting for sqlObj to be freed, %p", pObj, p);
taosMsleep(100);
// todo fix me!! two threads call taos_free_result will cause problem.
tscDebug("%p free :%p", pObj, p);
taos_free_result(p);
}
// while(1) {
// pthread_mutex_lock(&pObj->mutex);
// void* p = pObj->sqlList;
// pthread_mutex_unlock(&pObj->mutex);
//
// if (p == NULL) {
// break;
// }
//
// tscDebug("%p waiting for sqlObj to be freed, %p", pObj, p);
// taosMsleep(100);
//
// // todo fix me!! two threads call taos_free_result will cause problem.
// tscDebug("%p free :%p", pObj, p);
// taos_free_result(p);
// }
int32_t ref = T_REF_DEC(pObj);
assert(ref >= 0);
......@@ -605,8 +605,6 @@ void taos_free_result(TAOS_RES *res) {
return;
}
// assert(pSql->self != 0 && *pSql->self == pSql);
bool freeNow = tscKillQueryInDnode(pSql);
if (freeNow) {
tscDebug("%p free sqlObj in cache", pSql);
......
......@@ -366,7 +366,7 @@ void tscPartiallyFreeSqlObj(SSqlObj* pSql) {
tscResetSqlCmdObj(pCmd, false);
}
static void tscFreeSubobj(SSqlObj* pSql) {
static UNUSED_FUNC void tscFreeSubobj(SSqlObj* pSql) {
if (pSql->numOfSubs == 0) {
return;
}
......@@ -438,7 +438,7 @@ void tscFreeSqlObj(SSqlObj* pSql) {
tscDebug("%p start to free sqlObj", pSql);
STscObj* pTscObj = pSql->pTscObj;
tscFreeSubobj(pSql);
// tscFreeSubobj(pSql);
tscPartiallyFreeSqlObj(pSql);
pSql->signature = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册