use smart pointers in fdManager

This commit is contained in:
2025-06-04 12:43:27 -05:00
committed by Andrew Johnson
parent 3963b35c17
commit 87bb7d430f
2 changed files with 15 additions and 6 deletions
+4 -5
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();
}