aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-08-02 14:30:43 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-08-02 14:56:28 -0300
commit750c67576ea3356c0dd95d92ca1d667a220f11a8 (patch)
tree2a0a39085099ec5f9f0460cc9dcb44ea13ed1f33 /libshiboken
parent9cba9a581d503accb04e517d982d734b7795139f (diff)
Uses insert to append items to std::list.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/basewrapper.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index b48272bb9..dcd8c8724 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -379,7 +379,9 @@ void deallocWrapperWithPrivateDtor(PyObject* self)
void keepReference(SbkBaseWrapper* self, const char* key, PyObject* referredObject, bool append)
{
+
bool isNone = (!referredObject || (referredObject == Py_None));
+
if (!self->referredObjects)
self->referredObjects = new Shiboken::RefCountMap;
@@ -396,7 +398,7 @@ void keepReference(SbkBaseWrapper* self, const char* key, PyObject* referredObje
if (!isNone) {
std::list<PyObject*> values = splitPyObject(referredObject);
if (append && (iter != refCountMap.end()))
- refCountMap[key].assign(values.begin(), values.end());
+ refCountMap[key].insert(refCountMap[key].end(), values.begin(), values.end());
else
refCountMap[key] = values;
}