From: Mikko Rasa Date: Fri, 7 Oct 2016 22:27:34 +0000 (+0300) Subject: Fix memory leaks X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;ds=inline;p=libs%2Fvr.git Fix memory leaks --- diff --git a/source/stereocombiner.cpp b/source/stereocombiner.cpp index 34c13bd..dbbe815 100644 --- a/source/stereocombiner.cpp +++ b/source/stereocombiner.cpp @@ -37,6 +37,11 @@ StereoCombiner::StereoCombiner(): mirror(0) { } +StereoCombiner::~StereoCombiner() +{ + delete mirror; +} + void StereoCombiner::configure_eye_frustums(const Frustum &left_frustum, const Frustum &right_frustum) { float vertical = max(max(left_frustum.top, -left_frustum.bottom), max(right_frustum.top, -right_frustum.bottom)); diff --git a/source/stereocombiner.h b/source/stereocombiner.h index 88f979c..9dac08c 100644 --- a/source/stereocombiner.h +++ b/source/stereocombiner.h @@ -42,7 +42,7 @@ protected: StereoCombiner(); public: - virtual ~StereoCombiner() { } + virtual ~StereoCombiner(); protected: void configure_eye_frustums(const Frustum &, const Frustum &); diff --git a/source/stereoview.cpp b/source/stereoview.cpp index f08cd79..8684474 100644 --- a/source/stereoview.cpp +++ b/source/stereoview.cpp @@ -129,6 +129,11 @@ StereoView::Eye::Eye(): target(0) { } +StereoView::Eye::~Eye() +{ + delete target; +} + void StereoView::Eye::create_target(unsigned w, unsigned h) { delete target; diff --git a/source/stereoview.h b/source/stereoview.h index e31fa3d..75361ba 100644 --- a/source/stereoview.h +++ b/source/stereoview.h @@ -42,6 +42,7 @@ private: RenderTarget *target; Eye(); + ~Eye(); void create_target(unsigned, unsigned); void setup_frame(const GL::Camera &, float, const EyeParams &) const;