From fb7bdba38804f346892a0c3095559f8ec429df9b Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Mon, 20 Dec 2021 00:30:59 +0100 Subject: [PATCH] Code cleanup --- Interpolator.cpp | 7 ++++++- Interpolator.h | 1 + Selection.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Interpolator.cpp b/Interpolator.cpp index e84e836..add4f7a 100644 --- a/Interpolator.cpp +++ b/Interpolator.cpp @@ -150,14 +150,19 @@ Interpolator::Interpolator() } Interpolator::~Interpolator() +{ + clear(); +} + +void Interpolator::clear() { for (auto i = interpolators_.begin(); i != interpolators_.end(); ) { delete *i; i = interpolators_.erase(i); } - } + void Interpolator::add (Source *s, const SourceCore &target) { SourceInterpolator *i = new SourceInterpolator(s, target); diff --git a/Interpolator.h b/Interpolator.h index 6f9a987..b3b2e4b 100644 --- a/Interpolator.h +++ b/Interpolator.h @@ -30,6 +30,7 @@ public: Interpolator(); ~Interpolator(); + void clear (); void add (Source *s, const SourceCore &target ); void apply (float percent); diff --git a/Selection.h b/Selection.h index a983eb7..b1a76ea 100644 --- a/Selection.h +++ b/Selection.h @@ -1,6 +1,7 @@ #ifndef SELECTION_H #define SELECTION_H +#include #include "SourceList.h" class Selection