Fix issue with logger

This commit is contained in:
Daniel Chappuis 2018-04-03 07:08:19 +02:00
parent d55c7e3b91
commit 235b36ac47

View File

@ -163,9 +163,23 @@ Profiler::Profiler() :mRootNode("Root", nullptr), mDestinations(MemoryManager::g
// Destructor
Profiler::~Profiler() {
removeAllDestinations();
destroy();
}
// Remove all logs destination previously set
void Profiler::removeAllDestinations() {
// Delete all the destinations
for (uint i=0; i<mDestinations.size(); i++) {
delete mDestinations[i];
}
mDestinations.clear();
}
// Method called when we want to start profiling a block of code.
void Profiler::startProfilingBlock(const char* name) {
@ -214,17 +228,6 @@ void Profiler::printReport() {
}
}
// Remove all output profiling destinations previously set
void Profiler::removeAllDestinations() {
// Delete all the destinations
for (size_t i=0; i<mDestinations.size(); i++) {
delete mDestinations[i];
}
mDestinations.clear();
}
// Add a file destination to the profiler
void Profiler::addFileDestination(const std::string& filePath, Format format) {