- getting fanatical about memory cleanup so that valgrind output is more useful

This commit is contained in:
Mark Vejvoda
2011-09-30 23:55:07 +00:00
parent b57fb0ff39
commit 77a2fa7d48
6 changed files with 84 additions and 84 deletions

View File

@@ -561,6 +561,8 @@ UnitParticleSystem::UnitParticleSystem(int particleCount):
startTime = 0;
endTime = 1;
radiusBasedStartenergy = false;
}
UnitParticleSystem::~UnitParticleSystem(){

View File

@@ -192,6 +192,13 @@ CURL *SystemFlags::initHTTP() {
}
void SystemFlags::globalCleanupHTTP() {
if(curl_handle != NULL) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
SystemFlags::cleanupHTTP(&curl_handle, true);
curl_handle = NULL;
}
if(SystemFlags::curl_global_init_called == true) {
SystemFlags::curl_global_init_called = false;
//printf("HTTP cleanup\n");
@@ -297,14 +304,7 @@ SystemFlags::~SystemFlags() {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(curl_handle != NULL) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
SystemFlags::cleanupHTTP(&curl_handle, true);
curl_handle = NULL;
}
if(SystemFlags::curl_global_init_called == true) {
SystemFlags::globalCleanupHTTP();
}
SystemFlags::globalCleanupHTTP();
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}