summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-02 09:43:51 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-02 11:39:04 -0300
commit5f09931b15a03b445a47cb837f7ccd864853171b (patch)
tree9a487878b40a2925a45ed9b89ac9a7b31903ed14
parentb149541996fcd9fc0afbc0c4babc244c583a26e2 (diff)
downloadshiboken-5f09931b15a03b445a47cb837f7ccd864853171b.tar.gz
shiboken-5f09931b15a03b445a47cb837f7ccd864853171b.tar.xz
shiboken-5f09931b15a03b445a47cb837f7ccd864853171b.zip
Replaced use from QList to QSet in children list.1.0.0-beta5
Patch from farsmo <farsmo@sogetthis.com> Reviewer: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--libshiboken/basewrapper.cpp4
-rw-r--r--libshiboken/basewrapper_p.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index 055d7e62..fd686e3e 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -615,7 +615,7 @@ static void _destroyParentInfo(SbkObject* obj, bool keepReference)
ParentInfo* pInfo = obj->d->parentInfo;
if (pInfo) {
while(!pInfo->children.empty()) {
- SbkObject* first = pInfo->children.front();
+ SbkObject* first = *pInfo->children.begin();
// Mark child as invalid
Shiboken::Object::invalidate(first);
removeParent(first, false, keepReference);
@@ -941,7 +941,7 @@ void setParent(PyObject* parent, PyObject* child)
pInfo = child_->d->parentInfo = new ParentInfo;
pInfo->parent = parent_;
- parent_->d->parentInfo->children.push_back(child_);
+ parent_->d->parentInfo->children.insert(child_);
// Add Parent ref
Py_INCREF(child_);
diff --git a/libshiboken/basewrapper_p.h b/libshiboken/basewrapper_p.h
index f4ab6e65..5840b8c3 100644
--- a/libshiboken/basewrapper_p.h
+++ b/libshiboken/basewrapper_p.h
@@ -40,7 +40,7 @@ typedef std::map<std::string, std::list<SbkObject*> > RefCountMap;
/// Linked list of SbkBaseWrapper pointers
-typedef std::list<SbkObject*> ChildrenList;
+typedef std::set<SbkObject*> ChildrenList;
/// Struct used to store information about object parent and children.
struct ParentInfo