fix some memory lost
This commit is contained in:
parent
5b33531389
commit
1fb5a8c2fd
|
@ -249,6 +249,7 @@ static bool dnodeReadMnodeIpList() {
|
||||||
|
|
||||||
PARSE_OVER:
|
PARSE_OVER:
|
||||||
free(content);
|
free(content);
|
||||||
|
cJSON_Delete(root);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,6 +167,7 @@ void sdbCleanUp() {
|
||||||
sem_destroy(&tsSdbSync->sem);
|
sem_destroy(&tsSdbSync->sem);
|
||||||
pthread_mutex_destroy(&tsSdbSync->mutex);
|
pthread_mutex_destroy(&tsSdbSync->mutex);
|
||||||
walClose(tsSdbSync->wal);
|
walClose(tsSdbSync->wal);
|
||||||
|
free(tsSdbSync);
|
||||||
tsSdbSync = NULL;
|
tsSdbSync = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -576,5 +577,5 @@ void sdbCloseTable(void *handle) {
|
||||||
pthread_mutex_destroy(&pTable->mutex);
|
pthread_mutex_destroy(&pTable->mutex);
|
||||||
|
|
||||||
sdbTrace("table:%s, is closed, numOfTables:%d", pTable->tableName, tsSdbNumOfTables);
|
sdbTrace("table:%s, is closed, numOfTables:%d", pTable->tableName, tsSdbNumOfTables);
|
||||||
tfree(pTable);
|
free(pTable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#define TG_PASS_URL_POS 3
|
#define TG_PASS_URL_POS 3
|
||||||
|
|
||||||
void tgInitHandle(HttpServer *pServer);
|
void tgInitHandle(HttpServer *pServer);
|
||||||
|
void tgCleanupHandle();
|
||||||
|
|
||||||
bool tgProcessRquest(struct HttpContext *pContext);
|
bool tgProcessRquest(struct HttpContext *pContext);
|
||||||
|
|
||||||
|
|
|
@ -122,12 +122,14 @@ void httpStopSystem() {
|
||||||
if (httpServer != NULL) {
|
if (httpServer != NULL) {
|
||||||
httpServer->online = false;
|
httpServer->online = false;
|
||||||
}
|
}
|
||||||
|
tgCleanupHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void httpCleanUpSystem() {
|
void httpCleanUpSystem() {
|
||||||
httpPrint("http service cleanup");
|
httpPrint("http service cleanup");
|
||||||
httpStopSystem();
|
httpStopSystem();
|
||||||
#if 0
|
|
||||||
|
#if 1
|
||||||
if (httpServer == NULL) {
|
if (httpServer == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,7 @@ void tgFreeSchemas() {
|
||||||
}
|
}
|
||||||
free(tgSchemas.schemas);
|
free(tgSchemas.schemas);
|
||||||
tgSchemas.size = 0;
|
tgSchemas.size = 0;
|
||||||
|
tgSchemas.schemas = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,6 +291,10 @@ void tgInitHandle(HttpServer *pServer) {
|
||||||
httpAddMethod(pServer, &tgDecodeMethod);
|
httpAddMethod(pServer, &tgDecodeMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tgCleanupHandle() {
|
||||||
|
tgFreeSchemas();
|
||||||
|
}
|
||||||
|
|
||||||
bool tgGetUserFromUrl(HttpContext *pContext) {
|
bool tgGetUserFromUrl(HttpContext *pContext) {
|
||||||
HttpParser *pParser = &pContext->parser;
|
HttpParser *pParser = &pContext->parser;
|
||||||
if (pParser->path[TG_USER_URL_POS].len > TSDB_USER_LEN - 1 || pParser->path[TG_USER_URL_POS].len <= 0) {
|
if (pParser->path[TG_USER_URL_POS].len > TSDB_USER_LEN - 1 || pParser->path[TG_USER_URL_POS].len <= 0) {
|
||||||
|
|
Loading…
Reference in New Issue