Hi UnKNOw,

> if the filename has multibyte charset...
I suspect the problem is due to your use of the
auto_ptr<HashTransformation>. You can probably verify this by changing
the filename below.

When FileSource() goes out of scope, it will delete the objects it
owns, which is one HashFilter(). When HashFilter()  is deleted, it
will first delete objects it owns - the hash. So both the HashFilter()
dtor and auto_ptr<> will attempt to delete the hash object.

Jeff


On 4/3/08, UnKNOw <[EMAIL PROTECTED]> wrote:
>
> if the filename has multibyte charset, the filesource will crash.....
> who can tell me why,thanks!
>
> /////follow code is test
> string filename = "C:\\Documents and Settings\\Administrator\\桌面\
> \1.exe";
>
>        auto_ptr<HashTransformation> hash;
>        hash.reset(new CRC32);
>
>        string strDigest;
>        FileSource f(filename.c_str(), true, new HashFilter(*hash,      new
> HexEncoder(new StringSink(strDigest))));
>
>        return strDiges

--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---

Reply via email to