diff --git a/src/ioc/db/dbEvent.c b/src/ioc/db/dbEvent.c index 5e386dd5c..a5830881f 100644 --- a/src/ioc/db/dbEvent.c +++ b/src/ioc/db/dbEvent.c @@ -321,6 +321,22 @@ fail: return NULL; } + +epicsShareFunc void db_cleanup_events(void) +{ + freeListCleanup(dbevEventUserFreeList); + dbevEventUserFreeList = NULL; + + freeListCleanup(dbevEventQueueFreeList); + dbevEventQueueFreeList = NULL; + + freeListCleanup(dbevEventSubscriptionFreeList); + dbevEventSubscriptionFreeList = NULL; + + freeListCleanup(dbevFieldLogFreeList); + dbevFieldLogFreeList = NULL; +} + /* * DB_CLOSE_EVENTS() * diff --git a/src/ioc/db/dbEvent.h b/src/ioc/db/dbEvent.h index fe0e52f90..8ee109373 100644 --- a/src/ioc/db/dbEvent.h +++ b/src/ioc/db/dbEvent.h @@ -63,6 +63,10 @@ epicsShareFunc void db_flush_extra_labor_event (dbEventCtx); epicsShareFunc int db_post_extra_labor (dbEventCtx ctx); epicsShareFunc void db_event_change_priority ( dbEventCtx ctx, unsigned epicsPriority ); +#ifdef EPICS_PRIVATE_API +epicsShareFunc void db_cleanup_events(void); +#endif + typedef void EVENTFUNC (void *user_arg, struct dbChannel *chan, int eventsRemaining, struct db_field_log *pfl); diff --git a/src/ioc/db/dbUnitTest.c b/src/ioc/db/dbUnitTest.c index c259e1234..48ad0f0c6 100644 --- a/src/ioc/db/dbUnitTest.c +++ b/src/ioc/db/dbUnitTest.c @@ -12,6 +12,8 @@ #include +#define EPICS_PRIVATE_API + #include "dbmf.h" #include "epicsUnitTest.h" #include "osiFileName.h" @@ -90,6 +92,7 @@ void testIocShutdownOk(void) void testdbCleanup(void) { dbFreeBase(pdbbase); + db_cleanup_events(); initHookFree(); registryFree(); pdbbase = NULL;