aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2010-11-23 11:42:08 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:08:59 -0300
commitd17a105e2e71afd1f0b20576b73dcd95b5ca1806 (patch)
tree4bb1e469947cf248b3a6fb21684d6d3b8476dbbb /libshiboken
parent73360b909285ebfd57a0d24b83c64232b4d05a95 (diff)
Fixed generation with AVOID_PROTECTED_HACK.
Fixes bug #476. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/basewrapper.cpp9
-rw-r--r--libshiboken/basewrapper_p.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index 39c18c3e1..6fb69bf91 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -170,7 +170,7 @@ void SbkDeallocWrapper(PyObject* pyObj)
}
}
- Shiboken::Wrapper::deallocData(sbkObj);
+ Shiboken::Wrapper::deallocData(sbkObj, !sbkObj->d->containsCppWrapper);
}
void SbkDeallocWrapperWithPrivateDtor(PyObject* self)
@@ -179,8 +179,7 @@ void SbkDeallocWrapperWithPrivateDtor(PyObject* self)
if (sbkObj->weakreflist)
PyObject_ClearWeakRefs(self);
- Shiboken::BindingManager::instance().releaseWrapper(sbkObj);
- Shiboken::Wrapper::deallocData(sbkObj);
+ Shiboken::Wrapper::deallocData(sbkObj, true);
}
void SbkBaseTypeDealloc(PyObject* pyObj)
@@ -927,10 +926,10 @@ void setParent(PyObject* parent, PyObject* child)
Py_DECREF(child);
}
-void deallocData(SbkObject* self)
+void deallocData(SbkObject* self, bool cleanup)
{
// Make cleanup if this is not a wrapper otherwise this will be done on wrapper destructor
- if(!self->d->containsCppWrapper) {
+ if(cleanup) {
removeParent(self);
if (self->d->parentInfo)
diff --git a/libshiboken/basewrapper_p.h b/libshiboken/basewrapper_p.h
index 702fdbd07..428159e0a 100644
--- a/libshiboken/basewrapper_p.h
+++ b/libshiboken/basewrapper_p.h
@@ -229,7 +229,7 @@ void clearReferences(SbkObject* self);
/**
* Destroy internal data
**/
-void deallocData(SbkObject* self);
+void deallocData(SbkObject* self, bool doCleanup);
} // namespace Wrapper
} // namespace Shiboken