From a3b28f2924801bd59ea7924a652247269e6af928 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 31 Jul 2016 22:50:51 -0400 Subject: Reduce duplicated code --- ingen/LV2Features.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ingen') diff --git a/ingen/LV2Features.hpp b/ingen/LV2Features.hpp index 0bc3947b..2fe71f11 100644 --- a/ingen/LV2Features.hpp +++ b/ingen/LV2Features.hpp @@ -1,6 +1,6 @@ /* This file is part of Ingen. - Copyright 2007-2015 David Robillard + Copyright 2007-2016 David Robillard Ingen is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free @@ -45,6 +45,12 @@ public: virtual SPtr feature(World* world, Node* block) = 0; + +protected: + static void free_feature(LV2_Feature* feature) { + free(feature->data); + free(feature); + } }; class EmptyFeature : public Feature { -- cgit v1.2.1