Experimental Physics and
| |||||||||||||||||
|
If you are using Base R3.14.7 or later, there is a facility in libCom that you can use: void epicsAtExit((*epicsExitFunc)(void *arg), void *arg); You use it like this: #include "epicsExit.h" void myExit(void *myptr) { /* my cleanup code */ } ... epicsAtExit(myExit, (void *)myptr); ... When the IOC exits, the myExit routine will be called with myptr as its argument, which allows you to register the same routine several times with different pointers if you wish (you can always pass in NULL if you don't need a context pointer at all). If your code has to work on an earlier version of Base though, Mark Rivers' solution is your best bet. - Andrew -- There is no S in exprexxo.
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |