summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2010-07-29 09:57:22 -0300
committerLauro Neto <lauro.neto@openbossa.org>2010-08-03 14:29:13 -0300
commit647ebad0984a661a30047c18c0761b966ca06b6e (patch)
treeca0d1f954123294b6a3558ad61ae3c81d4405bf4
parent83c2720bcaf235927a04a12d82b7c0a70711316d (diff)
downloadshiboken-0.4.0.tar.gz
shiboken-0.4.0.tar.xz
shiboken-0.4.0.zip
Invalidate remaining instances when shutting down0.4.0
Instead of using assert(), invalidate the remaining instances in ~BindingManager(). This will prevent them of trying to access it again. As the program is already finishing, the dangling C++ instances will be freed anyway. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Reviewer: Renato Filho <renato.filho@openbossa.org>
-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;
}