Material: Fix memory leaks

This commit is contained in:
wmayer
2024-05-08 11:29:23 +02:00
committed by wwmayer
parent 5dc4a45afe
commit bf1fc57157
3 changed files with 16 additions and 15 deletions

View File

@@ -67,17 +67,17 @@ Py::List Array3DPy::getArray() const
auto array = getMaterial3DArrayPtr()->getArray();
for (auto& depth : array) {
Py::List* depthList = new Py::List();
Py::List depthList;
for (auto& row : *std::get<1>(depth)) {
Py::List* rowList = new Py::List();
Py::List rowList;
for (auto& column : *row) {
auto quantity = new Base::QuantityPy(new Base::Quantity(column));
rowList->append(Py::Object(quantity));
rowList.append(Py::asObject(quantity));
}
depthList->append(*rowList);
depthList.append(rowList);
}
list.append(*depthList);
list.append(depthList);
}
return list;