Menu

#598 2 memory leaks

2.3.x
open
nobody
None
5
2012-10-23
2010-04-26
runz
No

version: SVN trunk
OS: Linux

1:
graphsym.cpp
Newly allocated memory for _frag_atoms in the OBGraphSym constructor gets not freed.
A simple delete _frag_atoms; in the destructor solved it for my test case, but this has to be reviewed esp. if frag_atoms are given as parameters.

2:
obconversion.cpp
The last pLineEndBuf created in OBConversion::InstallStreamFilter() gets never freed.
'delete pLineEndBuf;' in the destructor worked though.

Discussion

  • Geoff Hutchison

    Geoff Hutchison - 2010-08-24

    Is this now fixed in SVN trunk? I know we've removed a number of minor memory leaks, including the pLineEndBuf.

     
  • runz

    runz - 2010-08-25

    The first leak is fixed, the second is still in place.
    Tested with latest trunk version (4012).

    I found the 'delete pLineEndBuf;' in the destructor commented out. If I uncomment it all leaks are gone for my testcases (most are for-loops with heavy OBConversion instantiation and ReadString usage.)
    I didnt look through all the OBConversion code, there might be cases where a delete of the pLineEndBuf in destructor segfaults, but for a simple OBConversion instantiation and ReadString usage the issue remains.