[TD-6169]<fix>: windows dll client can not quit.

This commit is contained in:
afwerar 2021-08-24 13:07:54 +08:00
parent d3af8a9d31
commit 745c5a918e
2 changed files with 2 additions and 3 deletions

View File

@ -199,9 +199,7 @@ void taos_init_imp(void) {
// In the APIs of other program language, taos_cleanup is not available yet.
// So, to make sure taos_cleanup will be invoked to clean up the allocated resource to suppress the valgrind warning.
#if !defined(TD_WINDOWS)
atexit(taos_cleanup);
#endif
tscDebug("client is initialized successfully");
}

View File

@ -537,7 +537,8 @@ void taosCacheCleanup(SCacheObj *pCacheObj) {
pCacheObj->deleting = 1;
// wait for the refresh thread quit before destroying the cache object.
while(atomic_load_8(&pCacheObj->deleting)) {
// But in the dll, the child thread will be killed before atexit takes effect.So here we only wait for one second.
for (int i = 0; i < 20&&atomic_load_8(&pCacheObj->deleting) != 0; i++) {
taosMsleep(50);
}