Commit 9f1697a1 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Fixed various initialization issues found by valgrind.

parent 3018dc6b
...@@ -66,6 +66,7 @@ namespace campvis { ...@@ -66,6 +66,7 @@ namespace campvis {
, _viewportSizeProp(viewportSizeProp) , _viewportSizeProp(viewportSizeProp)
, _cpnw(cameraProperty) , _cpnw(cameraProperty)
, _trackball(0) , _trackball(0)
, _sceneBounds(tgt::vec3(0.f))
{ {
tgtAssert(_cameraProperty != 0, "Assigned camera property must not be 0."); tgtAssert(_cameraProperty != 0, "Assigned camera property must not be 0.");
tgtAssert(_viewportSizeProp != 0, "Assigned viewport size property must not be 0."); tgtAssert(_viewportSizeProp != 0, "Assigned viewport size property must not be 0.");
......
...@@ -74,7 +74,7 @@ namespace sigslot { ...@@ -74,7 +74,7 @@ namespace sigslot {
while (! _stopExecution) { while (! _stopExecution) {
// try pop the next event from the event queue // try pop the next event from the event queue
_signal_handle_base* signal; _signal_handle_base* signal = nullptr;
if (_signalQueue.try_pop(signal)) { if (_signalQueue.try_pop(signal)) {
signal->processSignal(); signal->processSignal();
delete signal; delete signal;
......
...@@ -250,8 +250,16 @@ namespace sigslot { ...@@ -250,8 +250,16 @@ namespace sigslot {
/// Base class for signal handles that provides an interface to emit the signal. /// Base class for signal handles that provides an interface to emit the signal.
class SIGSLOT_API _signal_handle_base { class SIGSLOT_API _signal_handle_base {
public: public:
// default constructor
_signal_handle_base()
#ifdef CAMPVIS_DEBUG
: _callingLine(0)
#endif
{};
/// Virtual destructor /// Virtual destructor
virtual ~_signal_handle_base() {}; virtual ~_signal_handle_base() {};
/// Emits the signal of this signal handle. /// Emits the signal of this signal handle.
virtual void processSignal() const = 0; virtual void processSignal() const = 0;
...@@ -270,7 +278,6 @@ namespace sigslot { ...@@ -270,7 +278,6 @@ namespace sigslot {
#ifdef CAMPVIS_DEBUG #ifdef CAMPVIS_DEBUG
// This is debug information only, automatically removed from release builds // This is debug information only, automatically removed from release builds
std::string _callingFunction; ///< Function that emitted this signal std::string _callingFunction; ///< Function that emitted this signal
std::string _callingFile; ///< File which emitted this signal std::string _callingFile; ///< File which emitted this signal
int _callingLine; ///< Line where this signal was emitted int _callingLine; ///< Line where this signal was emitted
......
...@@ -53,6 +53,8 @@ namespace campvis { ...@@ -53,6 +53,8 @@ namespace campvis {
, p_enableScribbling("EnableScribbling", "Enable Scribbling in Slice Views", false) , p_enableScribbling("EnableScribbling", "Enable Scribbling in Slice Views", false)
, p_seProperties("SliceExtractorProperties", "Slice Extractor Properties") , p_seProperties("SliceExtractorProperties", "Slice Extractor Properties")
, p_vrProperties("VolumeRendererProperties", "Volume Renderer Properties") , p_vrProperties("VolumeRendererProperties", "Volume Renderer Properties")
, _shader(nullptr)
, _quad(nullptr)
, _raycaster(viewportSizeProp, raycaster) , _raycaster(viewportSizeProp, raycaster)
, _sliceRenderer(sliceRenderer) , _sliceRenderer(sliceRenderer)
, p_smallRenderSize("SmallRenderSize", "Small Render Size", tgt::ivec2(32), tgt::ivec2(0), tgt::ivec2(10000), tgt::ivec2(1)) , p_smallRenderSize("SmallRenderSize", "Small Render Size", tgt::ivec2(32), tgt::ivec2(0), tgt::ivec2(10000), tgt::ivec2(1))
...@@ -61,8 +63,11 @@ namespace campvis { ...@@ -61,8 +63,11 @@ namespace campvis {
, _ySliceHandler(&_sliceRenderer->p_ySliceNumber) , _ySliceHandler(&_sliceRenderer->p_ySliceNumber)
, _zSliceHandler(&_sliceRenderer->p_zSliceNumber) , _zSliceHandler(&_sliceRenderer->p_zSliceNumber)
, _windowingHandler(nullptr) , _windowingHandler(nullptr)
, _trackballEH(0) , _trackballEH(nullptr)
, _mousePressedInRaycaster(false) , _mousePressedInRaycaster(false)
, _viewUnderEvent(VOLUME)
, _eventPositionOffset(0)
, _eventViewportSize(0)
, _scribblePointer(nullptr) , _scribblePointer(nullptr)
, _cachedImageSize(0) , _cachedImageSize(0)
{ {
......
...@@ -67,10 +67,10 @@ protected: ...@@ -67,10 +67,10 @@ protected:
} }
~ConcurrentHistogramNDUniform() { ~ConcurrentHistogramNDUniform() {
delete max; delete [] max;
delete min; delete [] min;
delete numBuckets; delete [] numBuckets;
delete histogram; delete [] histogram;
} }
virtual void SetUp() { virtual void SetUp() {
...@@ -202,10 +202,10 @@ protected: ...@@ -202,10 +202,10 @@ protected:
} }
~ConcurrentHistogramNDSpecific() { ~ConcurrentHistogramNDSpecific() {
delete max; delete [] max;
delete min; delete [] min;
delete numBuckets; delete [] numBuckets;
delete histogram; delete [] histogram;
} }
virtual void SetUp() { virtual void SetUp() {
......
...@@ -145,8 +145,11 @@ GTEST_API_ int main(int argc, char **argv) { ...@@ -145,8 +145,11 @@ GTEST_API_ int main(int argc, char **argv) {
XInitThreads(); XInitThreads();
#endif #endif
app = new QApplication(argc, argv); app = new QApplication(argc, argv);
// Make Xlib and GLX thread safe under X11
QApplication::setAttribute(Qt::AA_X11InitThreads);
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
int ret; int ret;
......
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