Bug #1337
The SWIG interface seems to have trouble with objects returned by value
Status: | New | Start date: | 10/15/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | - | % Done: | 0% | |
Category: | - | |||
Target version: | - | |||
Duration: |
Recurrence
No recurrence.
Related issues
History
#1 Updated by Knödlseder Jürgen about 10 years ago
Concerning the memory leak, see the SWIG documentation: http://www.swig.org/Doc2.0/SWIG.html#SWIG_nn23
C functions that return structures or classes datatypes by value are more difficult to handle. [...] SWIG allocates a new object and returns a reference to it. It is up to the user to delete the returned object when it is no longer in use. Clearly, this will leak memory if you are unaware of the implicit memory allocation and don’t take steps to free the result. That said, it should be noted that some language modules can now automatically track newly created objects and reclaim memory for you.
So the question is whether something can be added to allow tracking of the memory allocation in Python.