Menu

#4 memory leak under vc.net 2003

open
nobody
None
5
2003-10-20
2003-10-20
Anonymous
No

I nocice that you comment out some "delete" in the
newest version.

That might be the cause of leak.

( older version has no leak )

Discussion

  • stephan beal

    stephan beal - 2004-09-01

    Logged In: YES
    user_id=32742

    i'm also curious about this. The commented-out deletes()
    appear to be intentional and valid, but some API docs
    explaining the pointer ownership for slot_disconnect() would
    clarify this point.

     
  • Nobody/Anonymous

    Logged In: NO

    m_connected_slots is an STL list, you first have to delete the memory and then erase it from the list, so just move the delete *it; before the m_connected_slots.erase(it)!!!!

     
  • Anonymous

    Anonymous - 2009-11-18

    I contacted the library developer and she agreed that uncommenting the delete and moving it before the erase is the proper thing to do. In her own words: "The suggested change works -- I think the code was commented out as a work around for a concurrency problem that is also fixed by that change, but never got reflected back to the published version."
    She also said: "you should still test it well, because I'm not in a position to verify it at the moment. I don't have VC++ on any of my machines currently"

     
  • Stepan Martinek

    Stepan Martinek - 2011-11-09

    Cool. I spent two days searching for a leak. Now when I wanted to post the solution here I have figured out that "Comments" label is clickable and the same solution is already here.
    The leakage is not only in VC++. It has the same behavior in Borland C++ and GCC (tried x86, ARM and SH platforms).

     

Log in to post a comment.

MongoDB Logo MongoDB