diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-29 00:19:47 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2009-11-30 13:11:16 -0300 |
commit | 0e2de944d5ddfce144a824280e08febbc8a1271a (patch) | |
tree | 3e01ab30d86a5fac291bc715f6faf6f26df6970d /libshiboken/bindingmanager.h | |
parent | 22fb6d89c445174e77afe698d247c72d05e1576a (diff) |
Wrapper invalidation method recursively updates children objects status.
BindingManager::invalidateWrapper checks if the object to be invalidated
carries any children objects and recursively invalidates them.
Shiboken::destroyParentInfo function was refactored to call the new
recursive wrapper invalidator and then call a helper function that
only destroy the parent information.
The invalidate parent test was updated.
Diffstat (limited to 'libshiboken/bindingmanager.h')
-rw-r--r-- | libshiboken/bindingmanager.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libshiboken/bindingmanager.h b/libshiboken/bindingmanager.h index 8785b681a..fe5767d32 100644 --- a/libshiboken/bindingmanager.h +++ b/libshiboken/bindingmanager.h @@ -41,6 +41,8 @@ namespace Shiboken { +struct PyBaseWrapper; + class LIBSHIBOKEN_API BindingManager { public: @@ -52,8 +54,13 @@ public: PyObject* retrieveWrapper(const void* cptr); PyObject* getOverride(const void* cptr, const char* methodName); - /// Invalidate the Python wrapper and removes the relations from C++ objects the Python wrapper. - void invalidateWrapper(PyObject* wrapper); + /// Invalidate the Python wrapper and removes the relations from C++ pointers to the Python wrapper. + void invalidateWrapper(PyBaseWrapper* wrapper); + /// Convenience method to call invalidateWrapper with a properly cast PyBaseWrapper. + inline void invalidateWrapper(PyObject* wrapper) + { + invalidateWrapper(reinterpret_cast<PyBaseWrapper*>(wrapper)); + } /// Convenience method to invalidate the Python wrapper for a C++ wrapped object. Do nothing if C++ pointer has no Python wrapper. void invalidateWrapper(const void* cptr); |