提交 c541d354 编写于 作者: S slguan

[TD-15] sdb may crash while received close signal

上级 6d35e620
...@@ -722,18 +722,20 @@ int32_t sdbUpdateRow(SSdbOperDesc *pOper) { ...@@ -722,18 +722,20 @@ int32_t sdbUpdateRow(SSdbOperDesc *pOper) {
void sdbCloseTable(void *handle) { void sdbCloseTable(void *handle) {
SSdbTable *pTable = (SSdbTable *)handle; SSdbTable *pTable = (SSdbTable *)handle;
void * pNode = NULL; void * pNode = NULL;
void * row;
if (pTable == NULL) return; if (pTable == NULL) return;
while (1) { while (1) {
pNode = sdbFetchRow(handle, pNode, &row); SRowMeta * pMeta;
if (row == NULL) break; pNode = (*sdbFetchRowFp[pTable->keyType])(pTable->iHandle, pNode, (void **)&pMeta);
if (pMeta == NULL) break;
SSdbOperDesc oper = { SSdbOperDesc oper = {
.pObj = pMeta->row,
.table = pTable, .table = pTable,
.rowData = row, .version = pMeta->version,
}; };
(*pTable->destroyFp)(&oper); (*pTable->destroyFp)(&oper);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册