ioc/db: dbUnitTest testMonitor leaks dbChannel

This commit is contained in:
Michael Davidsaver
2017-04-28 15:43:17 -04:00
parent be8de34130
commit d397f0fd92

View File

@@ -36,6 +36,7 @@ static ELLLIST testEvtList; /* holds testMonitor::node */
struct testMonitor {
ELLNODE node;
dbEventSubscription sub;
dbChannel *chan;
epicsEventId event;
unsigned count;
};
@@ -322,7 +323,7 @@ testMonitor* testMonitorCreate(const char* pvname, unsigned mask, unsigned opt)
mon->event = epicsEventMustCreate(epicsEventEmpty);
chan = dbChannelCreate(pvname);
chan = mon->chan = dbChannelCreate(pvname);
if(!chan)
testAbort("testMonitorCreate - dbChannelCreate(\"%s\") fails", pvname);
if(!!(status=dbChannelOpen(chan)))
@@ -353,6 +354,8 @@ void testMonitorDestroy(testMonitor *mon)
db_cancel_event(mon->sub);
dbChannelDelete(mon->chan);
epicsEventDestroy(mon->event);
free(mon);