From 7744c8b69d3d32de6dda061c62c7eab7b77db6b9 Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Sun, 10 Jan 2021 17:05:02 +0100 Subject: [PATCH] demux: adaptive: add inheritable wrapper deleter --- modules/demux/adaptive/playlist/Inheritables.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/demux/adaptive/playlist/Inheritables.hpp b/modules/demux/adaptive/playlist/Inheritables.hpp index 70d9c56992..51ac6731d9 100644 --- a/modules/demux/adaptive/playlist/Inheritables.hpp +++ b/modules/demux/adaptive/playlist/Inheritables.hpp @@ -105,12 +105,14 @@ namespace adaptive { public: AttrWrapper(T v) : AbstractAttr(e) { value = v; } - virtual ~AttrWrapper() {} + virtual ~AttrWrapper() { condDeleteValue(value); } AttrWrapper(const AttrWrapper &) = delete; AttrWrapper & operator=(const AttrWrapper &) = delete; operator const T&() const { return value; } protected: + void condDeleteValue(const T &) {} + void condDeleteValue(T* &v) { delete v; } T value; }; -- 2.11.4.GIT