commit 37610f3fef066377ebfd7bd7faf2178e80009b32
parent 37b67451efbc4fa5d430c3aab1ad67f7824c51e6
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 15 Jul 2015 11:24:24 +0200
Fix the release of a smc_estimator
The smc_estimator internal data were released with the generic MEM_RM
directive while one have to use the destroy function provided by the
smc_type structure.
Diffstat:
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/smc_integrator.c b/src/smc_integrator.c
@@ -33,7 +33,6 @@
#include "smc_device_c.h"
#include "smc_type_c.h"
-#include <rsys/clock_time.h>
#include <rsys/mem_allocator.h>
#include <limits.h>
@@ -123,15 +122,15 @@ estimator_release(ref_T* ref)
estimator = CONTAINER_OF(ref, struct smc_estimator, ref);
dev = estimator->dev;
if(estimator->value)
- MEM_RM(dev->allocator, estimator->value);
+ estimator->type.destroy(dev->allocator, estimator->value);
if(estimator->square_value)
- MEM_RM(dev->allocator, estimator->square_value);
+ estimator->type.destroy(dev->allocator, estimator->square_value);
if(estimator->status.E)
- MEM_RM(dev->allocator, estimator->status.E);
+ estimator->type.destroy(dev->allocator, estimator->status.E);
if(estimator->status.V)
- MEM_RM(dev->allocator, estimator->status.V);
+ estimator->type.destroy(dev->allocator, estimator->status.V);
if(estimator->status.SE)
- MEM_RM(dev->allocator, estimator->status.SE);
+ estimator->type.destroy(dev->allocator, estimator->status.SE);
MEM_RM(dev->allocator, estimator);
SMC(device_ref_put(dev));
}