-----Original Message-----
From: Vasudevan Sambasivam [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 3:30 PM
To: [EMAIL PROTECTED]
Subject: Sample code: Minor Bug?
I'm just learning about crypto++, so my question is probably elementary
in nature. Anyways, I was looking at the sample code in FAQ section:
void EncryptFile(const char *filein, const char *fileout, const char
*passPhrase) {
FileSource f(filein, true, new DefaultEncryptor(passPhrase,
new FileSink(fileout)));
}
The question I have is with the "new" objects being created (in this
case FileSink and DefaultEcnryptor). How does these gets deleted?
Understand that the sample code may be just for illustration only, but looks
like this is a bug. There are other samples with HexEncoder and so on.
Thanks,
+ Vasu
Hi Vasu,
>From the readme:
Finally, a couple of usage notes to keep in mind:
1. If a constructor for A takes a pointer to an object B (except primitive
types such as int and char), then A owns B and will delete B at A's
destruction. If a constructor for A takes a reference to an object B,
then the caller retains ownership of B and should not destroy it until
A no longer needs it.
2. Crypto++ is thread safe at the class level. This means you can use
Crypto++ safely in a multithreaded application, but you must provide
synchronization when multiple threads access a common Crypto++ object.
Jeff
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).