delete detail

This commit is contained in:
dmchen 2023-12-15 07:31:47 +00:00
parent 181642e6a1
commit 65f69b5fe4
1 changed files with 8 additions and 1 deletions

View File

@ -37,10 +37,17 @@ int32_t auditInit(const SAuditCfg *pCfg) {
return 0;
}
static FORCE_INLINE void auditDeleteRecord(SAuditRecord * record) {
if (record) {
taosMemoryFree(record->detail);
taosMemoryFree(record);
}
}
void auditCleanup() {
tsLogFp = NULL;
taosThreadMutexLock(&tsAudit.lock);
taosArrayDestroyP(tsAudit.records, (FDelete)taosMemoryFree);
taosArrayDestroyP(tsAudit.records, (FDelete)auditDeleteRecord);
taosThreadMutexUnlock(&tsAudit.lock);
tsAudit.records = NULL;
taosThreadMutexDestroy(&tsAudit.lock);