clear the stringlist before populating it
This commit is contained in:
parent
7c32ac2b3f
commit
8ad1d0bb99
1 changed files with 2 additions and 0 deletions
|
@ -74,6 +74,8 @@ bool python_get_stringlist(const char *name, std::vector<otk::ustring> *value)
|
|||
PyObject *val = PyDict_GetItemString(obdict, const_cast<char*>(name));
|
||||
if (!(val && PyList_Check(val))) return false;
|
||||
|
||||
value->clear();
|
||||
|
||||
for (int i = 0, end = PyList_Size(val); i < end; ++i) {
|
||||
PyObject *str = PyList_GetItem(val, i);
|
||||
if (PyString_Check(str))
|
||||
|
|
Loading…
Reference in a new issue