Fix conversion of variant list members

Item() returns either a Node* or (with wxUSE_STL=1) a
compatibility_iterator. While the former is silently and erroneously
converted to a Variant using the Variant(void*) overload, the STL
flavor fortunately failed. Dereference the Node*/iterator before
passing it to wxVariant_out_helper(const Variant&).
This commit is contained in:
Stefan Brüns
2020-05-30 02:04:41 +02:00
parent 73f75ea3e4
commit 5990d44b5e
2 changed files with 2 additions and 2 deletions

View File

@@ -182,7 +182,7 @@ PyObject* wxPGVariant_out_helper(const wxVariant& value)
size_t idx = 0;
PyObject* value = PyList_New(0);
for (idx=0; idx < sipCpp->GetCount(); idx++) {
PyObject* item = wxPGVariant_out_helper(sipCpp->Item(idx));
PyObject* item = wxPGVariant_out_helper(sipCpp->Item(idx)->GetData());
PyList_Append(value, item);
}
return value;

View File

@@ -77,7 +77,7 @@
size_t idx = 0;
PyObject* value = PyList_New(0);
for (idx=0; idx < sipCpp->GetCount(); idx++) {
PyObject* item = wxVariant_out_helper(sipCpp->Item(idx));
PyObject* item = wxVariant_out_helper(sipCpp->Item(idx)->GetData());
PyList_Append(value, item);
}
return value;