diff options
author | Matthew Newhook <matthew@zeroc.com> | 2007-09-20 14:08:46 +0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2007-09-20 14:08:46 +0800 |
commit | a276434d502514e90962be10a21afeb147ed621c (patch) | |
tree | 2e9d1dee105432e6a24de1f9f4031b5491ac82f0 /py/modules/IcePy/ObjectAdapter.cpp | |
parent | Another Makefile fix (diff) | |
download | ice-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.cpp | 8 |
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); } |