summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/ObjectAdapter.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2007-09-20 14:08:46 +0800
committerMatthew Newhook <matthew@zeroc.com>2007-09-20 14:08:46 +0800
commita276434d502514e90962be10a21afeb147ed621c (patch)
tree2e9d1dee105432e6a24de1f9f4031b5491ac82f0 /py/modules/IcePy/ObjectAdapter.cpp
parentAnother Makefile fix (diff)
downloadice-a276434d502514e90962be10a21afeb147ed621c.tar.bz2
ice-a276434d502514e90962be10a21afeb147ed621c.tar.xz
ice-a276434d502514e90962be10a21afeb147ed621c.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2478
Diffstat (limited to 'py/modules/IcePy/ObjectAdapter.cpp')
-rw-r--r--py/modules/IcePy/ObjectAdapter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/modules/IcePy/ObjectAdapter.cpp b/py/modules/IcePy/ObjectAdapter.cpp
index 8fb5c743b11..1c2f216e322 100644
--- a/py/modules/IcePy/ObjectAdapter.cpp
+++ b/py/modules/IcePy/ObjectAdapter.cpp
@@ -89,16 +89,13 @@ public:
private:
//
- // This object is created in locate() and destroyed after finished(). Ice guarantees
- // that these two functions are called in the same thread, therefore the AdoptThread
- // member does "the right thing".
+ // This object is created in locate() and destroyed after finished().
//
struct Cookie : public Ice::LocalObject
{
Cookie();
~Cookie();
- AdoptThread adoptThread;
PyObject* current;
ServantWrapperPtr servant;
PyObject* cookie;
@@ -211,6 +208,7 @@ IcePy::ServantLocatorWrapper::~ServantLocatorWrapper()
Ice::ObjectPtr
IcePy::ServantLocatorWrapper::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie)
{
+ AdoptThread adoptThread;
CookiePtr c = new Cookie; // The Cookie constructor adopts this thread.
c->current = createCurrent(current);
if(!c->current)
@@ -276,6 +274,7 @@ IcePy::ServantLocatorWrapper::locate(const Ice::Current& current, Ice::LocalObje
void
IcePy::ServantLocatorWrapper::finished(const Ice::Current&, const Ice::ObjectPtr&, const Ice::LocalObjectPtr& cookie)
{
+ AdoptThread adoptThread;
CookiePtr c = CookiePtr::dynamicCast(cookie);
assert(c);
@@ -319,6 +318,7 @@ IcePy::ServantLocatorWrapper::Cookie::Cookie()
IcePy::ServantLocatorWrapper::Cookie::~Cookie()
{
+ AdoptThread adoptThread;
Py_XDECREF(current);
Py_XDECREF(cookie);
}