aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken/basewrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libshiboken/basewrapper.cpp')
-rw-r--r--libshiboken/basewrapper.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index 5431c414..7527e3bb 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -869,6 +869,20 @@ void invalidate(SbkObject* self)
removeParent(*it, true, true);
}
}
+
+ // If has ref to other objects invalidate all
+ if (self->d->referredObjects) {
+ RefCountMap& refCountMap = *(self->d->referredObjects);
+ RefCountMap::iterator iter;
+ for (iter = refCountMap.begin(); iter != refCountMap.end(); ++iter) {
+ const std::list<PyObject*> lst = iter->second;
+ std::list<PyObject*>::const_iterator it = lst.begin();
+ while(it != lst.end()) {
+ invalidate(*it);
+ ++it;
+ }
+ }
+ }
}
void makeValid(SbkObject* self)
@@ -886,6 +900,21 @@ void makeValid(SbkObject* self)
for (; it != self->d->parentInfo->children.end(); ++it)
makeValid(*it);
}
+
+ // If has ref to other objects make all valid again
+ if (self->d->referredObjects) {
+ RefCountMap& refCountMap = *(self->d->referredObjects);
+ RefCountMap::iterator iter;
+ for (iter = refCountMap.begin(); iter != refCountMap.end(); ++iter) {
+ const std::list<PyObject*> lst = iter->second;
+ std::list<PyObject*>::const_iterator it = lst.begin();
+ while(it != lst.end()) {
+ if (Shiboken::Object::checkType(*it))
+ makeValid(reinterpret_cast<SbkObject*>(*it));
+ ++it;
+ }
+ }
+ }
}
bool hasParentInfo(SbkObject* pyObj)