Menu

#961 Memory Leak in Python Swig inteface (OBRotor object)

2.3.x
open
nobody
7
2015-06-09
2015-06-09
No

Hi,

I found a bug when trying to use OBRotor objects in Python openbabel library.
Everytime I call a method of this objects I get a warning

swig/python detected a memory leak of type 'std::vector< OpenBabel::OBRotor ,std::allocator< OpenBabel::OBRotor * > >::iterator ', no destructor found.

My code is something like this:
rbonds = openbabel.OBRotorList()
rbonds.Setup(mol)

rotor = rbonds.BeginRotor(rbonds.BeginRotors())
for i in range(rbonds.Size()):
    print rotor.Size()
    rotor = rbonds.NextRotor(rbonds.BeginRotors())

[]'s

Discussion