mirror of
https://github.com/glest/glest-source.git
synced 2025-09-26 07:28:59 +02:00
- more memory cleanup and thread cleanup (found using valgrind)
This commit is contained in:
@@ -177,6 +177,7 @@ std::string SystemFlags::getHTTP(std::string URL,CURL *handle,int timeOut,CURLco
|
||||
CURL *SystemFlags::initHTTP() {
|
||||
if(SystemFlags::curl_global_init_called == false) {
|
||||
SystemFlags::curl_global_init_called = true;
|
||||
//printf("HTTP init\n");
|
||||
CURLcode result = curl_global_init(CURL_GLOBAL_ALL);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] curl_global_init called and returned: result %d [%s]\n",__FILE__,__FUNCTION__,__LINE__,result,curl_easy_strerror(result));
|
||||
//printf("In [%s::%s Line %d] curl_global_init called and returned: result %d [%s]\n",__FILE__,__FUNCTION__,__LINE__,result,curl_easy_strerror(result));
|
||||
@@ -190,6 +191,15 @@ CURL *SystemFlags::initHTTP() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
void SystemFlags::globalCleanupHTTP() {
|
||||
if(SystemFlags::curl_global_init_called == true) {
|
||||
SystemFlags::curl_global_init_called = false;
|
||||
//printf("HTTP cleanup\n");
|
||||
curl_global_cleanup();
|
||||
//printf("In [%s::%s Line %d] curl_global_cleanup called\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
SystemFlags::SystemFlagsType & SystemFlags::getSystemSettingType(DebugType type) {
|
||||
if(SystemFlags::debugLogFileList == NULL) {
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
@@ -271,14 +281,6 @@ SystemFlags::SystemFlags() {
|
||||
|
||||
}
|
||||
|
||||
void SystemFlags::globalCleanupHTTP() {
|
||||
if(SystemFlags::curl_global_init_called == true) {
|
||||
SystemFlags::curl_global_init_called = false;
|
||||
curl_global_cleanup();
|
||||
//printf("In [%s::%s Line %d] curl_global_cleanup called\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
void SystemFlags::cleanupHTTP(CURL **handle, bool globalCleanup) {
|
||||
if(handle != NULL && *handle != NULL) {
|
||||
curl_easy_cleanup(*handle);
|
||||
@@ -375,8 +377,6 @@ void SystemFlags::Close() {
|
||||
}
|
||||
}
|
||||
|
||||
SystemFlags::globalCleanupHTTP();
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user