void IcePy::DefaultValueFactory::destroy() { if(_delegate) { FactoryWrapperPtr w = FactoryWrapperPtr::dynamicCast(_delegate); if(w) { w->destroy(); } } _delegate = 0; }
void IcePy::ValueFactoryManager::destroy() { AdoptThread adoptThread; // Ensure the current thread is able to call into Python. FactoryMap factories; { Lock lock(*this); if(_self == 0) { // // Nothing to do if already destroyed (this can occur if communicator destroy is called multiple times) // return; } // // Break the cyclic reference. // Py_DECREF(_self); _self = 0; factories.swap(_factories); } for(FactoryMap::iterator p = factories.begin(); p != factories.end(); ++p) { FactoryWrapperPtr w = FactoryWrapperPtr::dynamicCast(p->second); if(w) { w->destroy(); } } _defaultFactory->destroy(); }
void IceRuby::ValueFactoryManager::destroy() { FactoryMap factories; { Lock lock(*this); factories.swap(_factories); _self = Qnil; } for(FactoryMap::iterator p = factories.begin(); p != factories.end(); ++p) { FactoryWrapperPtr w = FactoryWrapperPtr::dynamicCast(p->second); if(w) { w->destroy(); } } _defaultFactory->destroy(); }