fix:[TD-33600] windows error if taos exist without connection

This commit is contained in:
wangmm0220 2025-01-23 14:45:30 +08:00
parent 94f6de8adc
commit 931f4e354f
1 changed files with 3 additions and 3 deletions

View File

@ -1627,8 +1627,8 @@ void tmqMgmtClose(void) {
tmqMgmt.timer = NULL; tmqMgmt.timer = NULL;
} }
(void) taosThreadMutexLock(&tmqMgmt.lock); if (tmqMgmt.rsetId > 0) {
if (tmqMgmt.rsetId >= 0) { (void) taosThreadMutexLock(&tmqMgmt.lock);
tmq_t *tmq = taosIterateRef(tmqMgmt.rsetId, 0); tmq_t *tmq = taosIterateRef(tmqMgmt.rsetId, 0);
int64_t refId = 0; int64_t refId = 0;
@ -1647,8 +1647,8 @@ void tmqMgmtClose(void) {
} }
taosCloseRef(tmqMgmt.rsetId); taosCloseRef(tmqMgmt.rsetId);
tmqMgmt.rsetId = -1; tmqMgmt.rsetId = -1;
(void)taosThreadMutexUnlock(&tmqMgmt.lock);
} }
(void)taosThreadMutexUnlock(&tmqMgmt.lock);
} }
tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) { tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {