diff --git a/include/os/osEnv.h b/include/os/osEnv.h index d4e94d6173a813e44e68355bb6a0ead964823ba1..c1fdc9e404c35dba510dafb76e2130ecbcc6ae05 100644 --- a/include/os/osEnv.h +++ b/include/os/osEnv.h @@ -60,6 +60,7 @@ bool osTempSpaceSufficient(); void osSetTimezone(const char *timezone); void osSetSystemLocale(const char *inLocale, const char *inCharSet); +void osSetProcPath(int32_t argc, char **argv); #ifdef __cplusplus } diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index c3c14020f3820cef5f321c7c93a2b8e24b302b39..3edeeee49a166c250a9cb4d2c280d51b34fd0347 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -1196,6 +1196,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile if (cfgLoadFromArray(tsCfg, pArgs) != 0) { uError("failed to load cfg from array since %s", terrstr()); cfgCleanup(tsCfg); + tsCfg = NULL; return -1; } diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index b565cbc318758d76caab7ee7488fe990b3fd0e9a..188677656a512be254815709532611013b805745 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -208,6 +208,7 @@ int mainWindows(int argc, char **argv) { taosCleanupCfg(); taosCloseLog(); taosCleanupArgs(); + taosConvDestroy(); return 0; } @@ -216,9 +217,11 @@ int mainWindows(int argc, char **argv) { taosCleanupCfg(); taosCloseLog(); taosCleanupArgs(); + taosConvDestroy(); return 0; } + osSetProcPath(argc, (char **)argv); taosCleanupArgs(); if (dmInit() != 0) { diff --git a/source/dnode/mgmt/node_mgmt/src/dmEnv.c b/source/dnode/mgmt/node_mgmt/src/dmEnv.c index 9e32ebcbd75604b635181252a4ff88a1b5da6659..a222ad3f7da738c8f2f9a84ac4f9463ae309b5d5 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmEnv.c +++ b/source/dnode/mgmt/node_mgmt/src/dmEnv.c @@ -132,8 +132,8 @@ void dmCleanup() { taosStopCacheRefreshWorker(); dInfo("dnode env is cleaned up"); - taosCloseLog(); taosCleanupCfg(); + taosCloseLog(); } void dmStop() { diff --git a/source/os/src/osEnv.c b/source/os/src/osEnv.c index 616ab7875dd9634b4ad4258c51320b589dd744ae..ac1881fc6d843b3ad215ceb809d44e5811c53328 100644 --- a/source/os/src/osEnv.c +++ b/source/os/src/osEnv.c @@ -105,3 +105,5 @@ void osSetSystemLocale(const char *inLocale, const char *inCharSet) { memcpy(tsLocale, inLocale, strlen(inLocale) + 1); memcpy(tsCharset, inCharSet, strlen(inCharSet) + 1); } + +void osSetProcPath(int32_t argc, char **argv) { tsProcPath = argv[0]; }