def release_ownership(old): logger.debug('Release %s', old) addr = getPointer(old) name = getName(old) if _addr2dtor.get((name, addr)) is None: clsname = getClassName(old) if not _pyclasses[clsname]._has_dtor(): return # Guard duplicated release raise Exception("Already released") _addr2dtor[(name, addr)] = None
def release_ownership(old): logger.debug('Release %s', old) addr = getPointer(old) name = getName(old) key = name, addr if key not in _addr2dtor: clsname = getClassName(old) if not _pyclasses[clsname]._has_dtor(): return # Guard duplicated release raise Exception("Already released") del _addr2dtor[key]