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

[td-1319]

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