diff options
Diffstat (limited to 'libshiboken/basewrapper_p.h')
-rw-r--r-- | libshiboken/basewrapper_p.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libshiboken/basewrapper_p.h b/libshiboken/basewrapper_p.h index 39b35f65d..35c9c83df 100644 --- a/libshiboken/basewrapper_p.h +++ b/libshiboken/basewrapper_p.h @@ -26,6 +26,8 @@ #include <Python.h> #include <list> #include <map> +#include <set> +#include <string> struct SbkObject; struct SbkObjectType; @@ -190,17 +192,26 @@ private: PyTypeObject* m_desiredType; }; +/// Call the destructor of each C++ object held by a Python object class DtorCallerVisitor : public HierarchyVisitor { public: DtorCallerVisitor(SbkObject* pyObj) : m_pyObj(pyObj) {} void visit(SbkObjectType* node); void done(); -private: +protected: std::list<std::pair<void*, SbkObjectType*> > m_ptrs; SbkObject* m_pyObj; }; +/// Dealloc of each C++ object held by a Python object, this implies a call to the C++ object destructor +class DeallocVisitor : public DtorCallerVisitor +{ +public: + DeallocVisitor(SbkObject* pyObj) : DtorCallerVisitor(pyObj) {} + void done(); +}; + /// \internal Internal function used to walk on classes inheritance trees. /** * Walk on class hierarchy using a DFS algorithm. |