summaryrefslogtreecommitdiffstats
path: root/libshiboken/bindingmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libshiboken/bindingmanager.cpp')
-rw-r--r--libshiboken/bindingmanager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libshiboken/bindingmanager.cpp b/libshiboken/bindingmanager.cpp
index 1a319011..56542535 100644
--- a/libshiboken/bindingmanager.cpp
+++ b/libshiboken/bindingmanager.cpp
@@ -92,6 +92,14 @@ BindingManager::~BindingManager()
showWrapperMap(m_d->wrapperMapper);
#endif
assert(m_d->wrapperMapper.size() == 0);
+
+ /* Cleanup hanging references. We just invalidate them as when
+ * the BindingManager is being destroyed the interpreter is alredy
+ * shutting down. */
+ WrapperMap::iterator iter = m_d->wrapperMapper.begin();
+ for (;iter != m_d->wrapperMapper.end(); ++iter)
+ invalidateWrapper(iter->second);
+
delete m_d;
}