diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-25 16:52:48 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-25 17:04:01 -0300 |
commit | ecc97184c0025d701ce7789e61ee55b84c29b942 (patch) | |
tree | 5ed9dea78fd8d024cb11798c83462c1edb5d5039 /libshiboken/bindingmanager.cpp | |
parent | b973238682789a8f6dc68ec824df8c8e14be0ce9 (diff) | |
parent | 32ec53b32affed4707712f33cd6a370ecc62ad7f (diff) |
Merged with multipleinheritance branch
Diffstat (limited to 'libshiboken/bindingmanager.cpp')
-rw-r--r-- | libshiboken/bindingmanager.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libshiboken/bindingmanager.cpp b/libshiboken/bindingmanager.cpp index a848e5e47..fc48348fc 100644 --- a/libshiboken/bindingmanager.cpp +++ b/libshiboken/bindingmanager.cpp @@ -85,7 +85,16 @@ void BindingManager::releaseWrapper(void *cptr) void BindingManager::releaseWrapper(PyObject* wrapper) { - releaseWrapper(PyBaseWrapper_cptr(wrapper)); + void* cptr = PyBaseWrapper_cptr(wrapper); + releaseWrapper(cptr); + if (((ShiboTypeObject*) wrapper->ob_type)->mi_offsets) { + int* offset = ((ShiboTypeObject*) wrapper->ob_type)->mi_offsets; + while (*offset != -1) { + if (*offset > 0) + BindingManager::instance().releaseWrapper((void*) ((size_t) cptr + (*offset))); + offset++; + } + } } PyObject* BindingManager::retrieveWrapper(const void* cptr) @@ -101,7 +110,7 @@ PyObject* BindingManager::getOverride(const void* cptr, const char* methodName) PyObject* wrapper = retrieveWrapper(cptr); if (wrapper) { - PyTypeObject* baseWrapperType = ((Shiboken::PyBaseWrapper*)wrapper)->baseWrapperType; + PyTypeObject* baseWrapperType = (PyTypeObject*) ((Shiboken::PyBaseWrapper*)wrapper)->baseWrapperType; PyObject* method = PyObject_GetAttrString(wrapper, const_cast<char*>(methodName)); if (method) { PyObject* defaultMethod = 0; |