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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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)!!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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)!!!!
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"
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).