summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2004-10-06 05:23:31 +0000
committerMarc Laukien <marc@zeroc.com>2004-10-06 05:23:31 +0000
commit9b007fa5e3fe322db4188b4c4e8eedc6a1e740fe (patch)
treeba85baad7fb30ae56f497ab8e6a86424eabfc6ef /cpp/src
parentfixes (diff)
downloadice-9b007fa5e3fe322db4188b4c4e8eedc6a1e740fe.tar.bz2
ice-9b007fa5e3fe322db4188b4c4e8eedc6a1e740fe.tar.xz
ice-9b007fa5e3fe322db4188b4c4e8eedc6a1e740fe.zip
fix
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Glacier2/RouterI.cpp4
-rw-r--r--cpp/src/Glacier2/SessionRouterI.cpp59
2 files changed, 44 insertions, 19 deletions
diff --git a/cpp/src/Glacier2/RouterI.cpp b/cpp/src/Glacier2/RouterI.cpp
index 008b6b4ede2..d47ef9f8609 100644
--- a/cpp/src/Glacier2/RouterI.cpp
+++ b/cpp/src/Glacier2/RouterI.cpp
@@ -69,6 +69,10 @@ Glacier2::RouterI::destroy()
if(_session)
{
+ //
+ // This can raise an exception, therefore it must be the last
+ // statement in this destroy() function.
+ //
_session->destroy();
}
}
diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp
index 00c914d2924..2238ae5b6ec 100644
--- a/cpp/src/Glacier2/SessionRouterI.cpp
+++ b/cpp/src/Glacier2/SessionRouterI.cpp
@@ -302,13 +302,6 @@ Glacier2::SessionRouterI::destroySession(const Current& current)
_routersByCategory.erase(category);
_routersByCategoryHint = _routersByCategory.end();
}
-
- if(_traceLevel >= 1)
- {
- Trace out(_logger, "Glacier2");
- out << "destroying session\n";
- out << router->toString();
- }
}
//
@@ -317,14 +310,24 @@ Glacier2::SessionRouterI::destroySession(const Current& current)
//
try
{
+ if(_traceLevel >= 1)
+ {
+ Trace out(_logger, "Glacier2");
+ out << "destroying session\n";
+ out << router->toString();
+ }
+
router->destroy();
}
catch(const Ice::Exception& ex)
{
- Trace out(_logger, "Glacier2");
- out << "exception while destroying session\n";
- out << ex;
- ex.ice_throw();
+ if(_traceLevel >= 1)
+ {
+ Trace out(_logger, "Glacier2");
+ out << "exception while destroying session\n";
+ out << ex;
+ ex.ice_throw();
+ }
}
}
@@ -432,13 +435,6 @@ Glacier2::SessionRouterI::run()
_routersByCategory.erase(category);
_routersByCategoryHint = _routersByCategory.end();
}
-
- if(_traceLevel >= 1)
- {
- Trace out(_logger, "Glacier2");
- out << "expiring session\n";
- out << router->toString();
- }
}
else
{
@@ -451,7 +447,32 @@ Glacier2::SessionRouterI::run()
// We destroy the expired routers outside the thread
// synchronization, to avoid deadlocks.
//
- for_each(routers.begin(), routers.end(), IceUtil::voidMemFun(&RouterI::destroy));
+ for(vector<RouterIPtr>::iterator p = routers.begin(); p != routers.end(); ++p)
+ {
+ RouterIPtr router = *p;
+
+ try
+ {
+ if(_traceLevel >= 1)
+ {
+ Trace out(_logger, "Glacier2");
+ out << "expiring session\n";
+ out << router->toString();
+ }
+
+ router->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ if(_traceLevel >= 1)
+ {
+ Trace out(_logger, "Glacier2");
+ out << "exception while expiring session\n";
+ out << ex;
+ ex.ice_throw();
+ }
+ }
+ }
}
}