From bf9cd7241abe5351ff405cea2395fb81eb714d71 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 13 Aug 2004 01:10:03 +0000 Subject: [PATCH] added try catch block --- src/cas/generic/caServerI.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/cas/generic/caServerI.cc b/src/cas/generic/caServerI.cc index 3e07e7b8a..76af364a5 100644 --- a/src/cas/generic/caServerI.cc +++ b/src/cas/generic/caServerI.cc @@ -121,12 +121,17 @@ void serverToolDebugFunc (const char *pFile, unsigned line, const char *pComment caStatus caServerI::attachInterface ( const caNetAddr & addrIn, bool autoBeaconAddr, bool addConfigBeaconAddr) { - casIntfOS * pIntf = new casIntfOS ( *this, this->clientBufMemMgr, - addrIn, autoBeaconAddr, addConfigBeaconAddr ); - - { - epicsGuard < epicsMutex > locker ( this->mutex ); - this->intfList.add ( *pIntf ); + try { + casIntfOS * pIntf = new casIntfOS ( *this, this->clientBufMemMgr, + addrIn, autoBeaconAddr, addConfigBeaconAddr ); + + { + epicsGuard < epicsMutex > locker ( this->mutex ); + this->intfList.add ( *pIntf ); + } + } + catch ( ... ) { + return S_cas_bindFail; } return S_cas_success;