use auto_ptr or unique_ptr

This commit is contained in:
Michael Davidsaver
2020-10-26 15:09:13 -07:00
parent d83e3b5de1
commit db2f7d8b92
5 changed files with 40 additions and 7 deletions

View File

@@ -153,13 +153,13 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
this->localPort = htons ( tmpAddr.ia.sin_port );
}
std::auto_ptr < CallbackGuard > pCBGuard;
ca::auto_ptr < CallbackGuard > pCBGuard;
if ( ! enablePreemptiveCallback ) {
pCBGuard.reset ( new CallbackGuard ( this->cbMutex ) );
}
// multiple steps ensure exception safety
this->pCallbackGuard = pCBGuard;
this->pCallbackGuard = PTRMOVE(pCBGuard);
}
ca_client_context::~ca_client_context ()