asShutdown

This commit is contained in:
Michael Davidsaver
2014-06-23 16:28:22 -04:00
committed by Michael Davidsaver
parent 2d4e143987
commit ad2bb0725d
5 changed files with 13 additions and 2 deletions

View File

@@ -152,6 +152,15 @@ int asInit(void)
return(asInitCommon());
}
int asShutdown(void) {
volatile ASBASE *pbase = pasbase;
pasbase = NULL;
firstTime = TRUE;
if(pbase)
asFreeAll((ASBASE*)pbase);
return 0;
}
static void wdCallback(void *arg)
{
ASDBCALLBACK *pcallback = (ASDBCALLBACK *)arg;

View File

@@ -32,6 +32,7 @@ epicsShareFunc int asSetFilename(const char *acf);
epicsShareFunc int asSetSubstitutions(const char *substitutions);
epicsShareFunc int asInit(void);
epicsShareFunc int asInitAsyn(ASDBCALLBACK *pcallback);
epicsShareFunc int asShutdown(void);
epicsShareFunc int asDbGetAsl(struct dbChannel *chan);
epicsShareFunc void * asDbGetMemberPvt(struct dbChannel *chan);
epicsShareFunc int asdbdump(void);

View File

@@ -658,6 +658,7 @@ int iocShutdown(void)
scanShutdown();
callbackShutdown();
iterateRecords(doFreeRecord, NULL);
asShutdown();
iocState = iocStopped;
return 0;
}

View File

@@ -222,6 +222,7 @@ epicsShareFunc long epicsShareAPI asComputeAsg(ASG *pasg);
/*following is "friend" function*/
epicsShareFunc void * epicsShareAPI asCalloc(size_t nobj,size_t size);
epicsShareFunc char * epicsShareAPI asStrdup(unsigned char *str);
epicsShareFunc void asFreeAll(ASBASE *pasbase);
#ifdef __cplusplus
}
#endif

View File

@@ -51,7 +51,6 @@ static long asAddMemberPvt(ASMEMBERPVT *pasMemberPvt,const char *asgName);
static long asComputeAllAsgPvt(void);
static long asComputeAsgPvt(ASG *pasg);
static long asComputePvt(ASCLIENTPVT asClientPvt);
static void asFreeAll(ASBASE *pasbase);
static UAG *asUagAdd(const char *uagName);
static long asUagAddUser(UAG *puag,const char *user);
static HAG *asHagAdd(const char *hagName);
@@ -1015,7 +1014,7 @@ next_rule:
return(0);
}
static void asFreeAll(ASBASE *pasbase)
void asFreeAll(ASBASE *pasbase)
{
UAG *puag;
UAGNAME *puagname;