mirror of
https://github.com/glest/glest-source.git
synced 2025-08-18 14:11:15 +02:00
- getting fanatical about memory cleanup so that valgrind output is more useful
This commit is contained in:
@@ -273,23 +273,16 @@ T* FileReader<T>::readPath(const string& filepath, T* object) {
|
||||
template <typename T>
|
||||
FileReader<T>::FileReader(std::vector<string> extensions): extensions(extensions) {
|
||||
getFileReaders().push_back(this);
|
||||
//string const * nextExtension = extensions;
|
||||
std::vector<string> nextExtension = extensions;
|
||||
//while (((*nextExtension) != "")) {
|
||||
for(unsigned int i = 0; i < nextExtension.size(); ++i) {
|
||||
//vector<FileReader<T> const* >* curPossibleReaders = (getFileReadersMap())[*nextExtension];
|
||||
vector<FileReader<T> const* >* curPossibleReaders = (getFileReadersMap())[nextExtension[i]];
|
||||
if (curPossibleReaders == NULL) {
|
||||
//(getFileReadersMap())[*nextExtension] = (curPossibleReaders = new vector<FileReader<T> const *>());
|
||||
(getFileReadersMap())[nextExtension[i]] = (curPossibleReaders = new vector<FileReader<T> const *>());
|
||||
}
|
||||
curPossibleReaders->push_back(this);
|
||||
//++nextExtension;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**Gives a quick estimation of whether the specified file
|
||||
* can be read or not depending on the filename*/
|
||||
template <typename T>
|
||||
|
@@ -561,6 +561,8 @@ UnitParticleSystem::UnitParticleSystem(int particleCount):
|
||||
|
||||
startTime = 0;
|
||||
endTime = 1;
|
||||
|
||||
radiusBasedStartenergy = false;
|
||||
}
|
||||
|
||||
UnitParticleSystem::~UnitParticleSystem(){
|
||||
|
@@ -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__);
|
||||
}
|
||||
|
Reference in New Issue
Block a user