From d94840ae6c84a8001a62ddf35d6198febc32da49 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 21 Dec 2015 13:44:23 -0500 Subject: [PATCH] std/filter: plugins cleanup freeList --- src/std/filters/arr.c | 7 +++++++ src/std/filters/dbnd.c | 7 +++++++ src/std/filters/sync.c | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/src/std/filters/arr.c b/src/std/filters/arr.c index b872cd623..889a94ef4 100644 --- a/src/std/filters/arr.c +++ b/src/std/filters/arr.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -200,6 +201,11 @@ static chfPluginIf pif = { NULL /* channel_close */ }; +static void arrShutdown(void* ignore) +{ + freeListCleanup(myStructFreeList); +} + static void arrInitialize(void) { static int firstTime = 1; @@ -211,6 +217,7 @@ static void arrInitialize(void) freeListInitPvt(&myStructFreeList, sizeof(myStruct), 64); chfPluginRegister("arr", &pif, opts); + epicsAtExit(arrShutdown, NULL); } epicsExportRegistrar(arrInitialize); diff --git a/src/std/filters/dbnd.c b/src/std/filters/dbnd.c index 0278a9a33..ec3a255fc 100644 --- a/src/std/filters/dbnd.c +++ b/src/std/filters/dbnd.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -121,6 +122,11 @@ static chfPluginIf pif = { NULL /* channel_close */ }; +static void dbndShutdown(void* ignore) +{ + freeListCleanup(myStructFreeList); +} + static void dbndInitialize(void) { static int firstTime = 1; @@ -132,6 +138,7 @@ static void dbndInitialize(void) freeListInitPvt(&myStructFreeList, sizeof(myStruct), 64); chfPluginRegister("dbnd", &pif, opts); + epicsAtExit(dbndShutdown, NULL); } epicsExportRegistrar(dbndInitialize); diff --git a/src/std/filters/sync.c b/src/std/filters/sync.c index 2646aefa6..ce21eb7e7 100644 --- a/src/std/filters/sync.c +++ b/src/std/filters/sync.c @@ -16,6 +16,7 @@ #include "db_field_log.h" #include "chfPlugin.h" #include "dbState.h" +#include "epicsExit.h" #include "epicsAssert.h" #include "epicsExport.h" @@ -174,6 +175,11 @@ static chfPluginIf pif = { NULL /* channel_close */ }; +static void syncShutdown(void* ignore) +{ + freeListCleanup(myStructFreeList); +} + static void syncInitialize(void) { static int firstTime = 1; @@ -185,6 +191,7 @@ static void syncInitialize(void) freeListInitPvt(&myStructFreeList, sizeof(myStruct), 64); chfPluginRegister("sync", &pif, opts); + epicsAtExit(syncShutdown, NULL); } epicsExportRegistrar(syncInitialize);