aboutsummaryrefslogtreecommitdiffstats
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)
Invalidate remaining instances when shutting downsb-0.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 1a3190117..565425355 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;
}