fix(stmt2/close): wait asnyc cb completed to free itself

This commit is contained in:
Minglei Jin 2024-09-12 14:24:11 +08:00
parent 9eeec14f7e
commit fba5560f1b
1 changed files with 1 additions and 1 deletions

View File

@ -1667,7 +1667,6 @@ int stmtExec2(TAOS_STMT2* stmt, int* affected_rows) {
STMT_ERR_RET(stmtCleanExecInfo(pStmt, (code ? false : true), false));
++pStmt->sql.runTimes;
} else {
SSqlCallbackWrapper* pWrapper = taosMemoryCalloc(1, sizeof(SSqlCallbackWrapper));
if (pWrapper == NULL) {
@ -1718,6 +1717,7 @@ int stmtClose2(TAOS_STMT2* stmt) {
STMT_ERR_RET(stmtCleanSQLInfo(pStmt));
if (pStmt->options.asyncExecFn) {
(void)tsem_wait(&pStmt->asyncQuerySem);
(void)tsem_destroy(&pStmt->asyncQuerySem);
}
taosMemoryFree(stmt);