Great, thanks! It's generally concerning when you see a "new" without a corresponding "delete", it might be helpful to have this behavior (implicit destruction of objects passed into the constructor) documented in the wiki. Thanks for your help.
Rod >________________________________ > From: Geoff Beier <[email protected]> >To: Ken Rune Helland <[email protected]> >Cc: [email protected] >Sent: Friday, March 16, 2012 8:02 AM >Subject: Re: Memory leak in Crypto++ examples? > > > > > >On Fri, Mar 16, 2012 at 02:55, Ken Rune Helland <[email protected]> wrote: > > >>I have not read the source, but from your eksample it is clear the >>Stringsource expects to "own" the passed StreamTransformationFilter >>object and deletes it in its own destruktor. >> >> > > >I can't find where I saw it documented, so don't take this as a guarantee, but >this pattern is quite common in crypto++. If an object's constructor takes a >bare pointer, it generally assumes responsibility for using delete to free >that pointer. So make sure you allocate it with the new that corresponds to >the delete crypto++ is using. I cannot, offhand, think of a constructor I've >seen in the library that doesn't follow this pattern. > > >Geoff -- >You received this message because you are subscribed to the "Crypto++ Users" >Google Group. >To unsubscribe, send an email to [email protected]. >More information about Crypto++ and this group is available at >http://www.cryptopp.com. > > -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com.
