diff --git a/src/ioc/PVAServerRegister.cpp b/src/ioc/PVAServerRegister.cpp index dba4b96..fbee91f 100644 --- a/src/ioc/PVAServerRegister.cpp +++ b/src/ioc/PVAServerRegister.cpp @@ -103,10 +103,16 @@ void pvasr(int lvl) } } +void pva_server_cleanup(void *) +{ + stopPVAServer(); +} + void initStartPVAServer(initHookState state) { pvd::Lock G(the_server_lock); if(state==initHookAfterIocRunning && !the_server) { + epicsAtExit(&pva_server_cleanup, 0); startitup(); } else if(state==initHookAtIocPause) { @@ -114,7 +120,6 @@ void initStartPVAServer(initHookState state) } } - void registerStartPVAServer(void) { epics::iocshRegister("startPVAServer", "provider names");