use smart pointers in fdManager

This commit is contained in:
2025-01-30 12:02:49 +01:00
parent 5eb9997791
commit 27f4261dfb
2 changed files with 15 additions and 6 deletions

View File

@@ -56,7 +56,7 @@ struct fdManagerPrivate {
tsDLList < fdReg > activeList;
resTable < fdReg, fdRegId > fdTbl;
const double sleepQuantum;
epicsTimerQueuePassive * pTimerQueue;
epics::auto_ptr <epicsTimerQueuePassive> pTimerQueue;
bool processInProg;
#ifdef FDMGR_USE_POLL
@@ -81,14 +81,14 @@ struct fdManagerPrivate {
fdManagerPrivate::fdManagerPrivate(fdManager & owner) :
sleepQuantum(epicsThreadSleepQuantum()),
pTimerQueue(0), processInProg(false),
processInProg(false),
pCBReg(0), owner(owner)
{}
inline void fdManagerPrivate::lazyInitTimerQueue ()
{
if (!pTimerQueue) {
pTimerQueue = & epicsTimerQueuePassive::create(owner);
if (!pTimerQueue.get()) {
pTimerQueue.reset(&epicsTimerQueuePassive::create(owner));
}
}
@@ -138,7 +138,6 @@ LIBCOM_API fdManager::~fdManager()
pReg->state = fdReg::limbo;
pReg->destroy();
}
delete priv->pTimerQueue;
osiSockRelease();
}