diff options
Diffstat (limited to 'cpp/src/Ice/Reference.cpp')
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 169a5c71a0c..dffa814cee1 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -1590,17 +1590,26 @@ IceInternal::IndirectReference::getConnection(bool& comp) const if(!getRouterInfo()) { assert(_locatorInfo); - const IndirectReferencePtr self = const_cast<IndirectReference*>(this); - _locatorInfo->clearCache(self); + + // COMPILERFIX: Braces needed to prevent BCB from causing Reference refCount from + // being decremented twice when loop continues. + { + const IndirectReferencePtr self = const_cast<IndirectReference*>(this); + _locatorInfo->clearCache(self); + } if(cached) { - TraceLevelsPtr traceLevels = getInstance()->traceLevels(); - if(traceLevels->retry >= 2) + // COMPILERFIX: Braces needed to prevent BCB from causing TraceLevels refCount from + // being decremented twice when loop continues. { - Trace out(getInstance()->initializationData().logger, traceLevels->retryCat); - out << "connection to cached endpoints failed\n" - << "removing endpoints from cache and trying one more time\n" << ex; + TraceLevelsPtr traceLevels = getInstance()->traceLevels(); + if(traceLevels->retry >= 2) + { + Trace out(getInstance()->initializationData().logger, traceLevels->retryCat); + out << "connection to cached endpoints failed\n" + << "removing endpoints from cache and trying one more time\n" << ex; + } } continue; } |