Commit 13830f64 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Fixing a bunch of memory leaks.

According to Visual Leak Detector, CAMPVis is now memory leak free. :)
parent ee66aac2
......@@ -35,13 +35,16 @@
#include "tgt/qt/qtthreadedcanvas.h"
#include "application/campvispainter.h"
#include "application/gui/properties/propertywidgetfactory.h"
#include "application/gui/mainwindow.h"
#include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/simplejobprocessor.h"
#include "core/tools/stringutils.h"
#include "core/tools/quadrenderer.h"
#include "core/pipeline/abstractpipeline.h"
#include "core/datastructures/imagerepresentationconverter.h"
#include "core/pipeline/visualizationprocessor.h"
#include "modules/pipelinefactory.h"
......@@ -210,13 +213,16 @@ namespace campvis {
tgt::deinitGL();
}
SimpleJobProcessor::deinit();
OpenGLJobProcessor::deinit();
PipelineFactory::deinit();
tgt::GlContextManager::deinit();
tgt::deinit();
OpenGLJobProcessor::deinit();
SimpleJobProcessor::deinit();
PropertyWidgetFactory::deinit();
ImageRepresentationConverter::deinit();
PipelineFactory::deinit();
// MainWindow dtor needs a valid CampVisApplication, so we need to call it here instead of during destruction.
delete _mainWindow;
......
......@@ -37,6 +37,8 @@
#include <ctime>
#ifdef CAMPVIS_DEBUG
// Anonymous OpenGL helper functions
namespace {
GLboolean getGlBool(GLenum param) {
......@@ -57,6 +59,7 @@ namespace {
return toReturn;
}
}
#endif
namespace campvis {
......
......@@ -37,7 +37,7 @@ namespace campvis {
size = 1;
while (true) {
void* toReturn = OpenGLJobProcessor::getRef()._signalPool.malloc(size);
void* toReturn = OpenGLJobProcessor::getRef()._jobPool.malloc(size);
if (toReturn != nullptr)
return toReturn;
......@@ -57,7 +57,7 @@ namespace campvis {
if (rawMemory == nullptr)
return;
OpenGLJobProcessor::getRef()._signalPool.free(rawMemory);
OpenGLJobProcessor::getRef()._jobPool.free(rawMemory);
}
}
......@@ -71,6 +71,7 @@ namespace campvis {
_contextQueueMap.clear();
_contexts.clear();
_jobPool.recycle();
}
void OpenGLJobProcessor::stop() {
......
......@@ -212,7 +212,7 @@ namespace campvis {
private:
typedef std::allocator<AbstractJob> pool_allocator_t;
tbb::memory_pool<pool_allocator_t> _signalPool; ///< Memory pool for the signals
tbb::memory_pool<pool_allocator_t> _jobPool; ///< Memory pool for the signals
static std::thread::id _this_thread_id;
};
......
......@@ -46,6 +46,7 @@ namespace campvis {
void PipelineFactory::deinit() {
delete _singleton;
_singleton = nullptr;
}
......
......@@ -92,7 +92,7 @@ namespace campvis {
}
VolumeRenderer::~VolumeRenderer() {
delete _raycaster;
}
void VolumeRenderer::init() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment