summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-09-30 17:51:43 +0000
committerMarc Laukien <marc@zeroc.com>2002-09-30 17:51:43 +0000
commite1e3c23eb93918e12ffbe031608dfbd50d68a14c (patch)
tree22056f159dfd4601a05aa298ec54ebf243428c35 /cpp/src
parentFixed typo in comment. (diff)
downloadice-e1e3c23eb93918e12ffbe031608dfbd50d68a14c.tar.bz2
ice-e1e3c23eb93918e12ffbe031608dfbd50d68a14c.tar.xz
ice-e1e3c23eb93918e12ffbe031608dfbd50d68a14c.zip
bug fixes ; added adapter deactivation tests
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Direct.cpp4
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp6
2 files changed, 7 insertions, 3 deletions
diff --git a/cpp/src/Ice/Direct.cpp b/cpp/src/Ice/Direct.cpp
index 37230f9d466..27ba75fd9db 100644
--- a/cpp/src/Ice/Direct.cpp
+++ b/cpp/src/Ice/Direct.cpp
@@ -22,10 +22,10 @@ using namespace IceInternal;
IceInternal::Direct::Direct(const Current& current) :
_current(current)
{
+ dynamic_cast<ObjectAdapterI*>(_current.adapter.get())->incUsageCount();
+
try
{
- dynamic_cast<ObjectAdapterI*>(_current.adapter.get())->incUsageCount();
-
_servant = _current.adapter->identityToServant(_current.id);
if(!_servant && !_current.id.category.empty())
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index 31329f20b5b..c5b41c01226 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -457,7 +457,11 @@ Ice::ObjectAdapterI::incUsageCount()
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
- assert(_instance); // Must not be called after deactivation.
+ if(!_instance)
+ {
+ throw ObjectAdapterDeactivatedException(__FILE__, __LINE__);
+ }
+
assert(_usageCount >= 0);
++_usageCount;
}