Bugfix: Memory leaks due to not deleted private data

Hi guys,

I noticed while working on Connection2 that the private data was not freed. Since I actually copied the code from the old version I checked there and yes, the same leak. Then I did a search in the source code for all new .*Private and oh, my god! What have I programmed? Memory not freed also in UdpConnection, ResponseHeader, RequestHeader and LocalPeer. I’ll have to run calitko in valrgind again some time soon.

I fixed the leaks by using auto_ptr, which is initialized in the ctor initialization list. The attached patch is now in my BitTorrent branch only but will be merged before the next release.

Regards,

Peter

Would you like to post a relpy?


This post starts a thread.
No follow-ups yet.