at first excuse for my bad English .
i am using Microsoft ISA Server 2006 c++ programming SDK .
i get the information from Isa server by isa functions that needs 开发者_开发技巧 BSTR variable , but it make memory leak and by using ::sysFreeString(BSTR)
it doesn't solve the memory leak .
what should i have to do ?
FPCLib::IFPCLogEntryPtr::get_ClientIP(BSTR *);
By default, COM BSTR
values are cached by the runtime library, which can give the appearance of a leak over time. Even though your own code has no leaks, the heap size still grows - very annoying.
If you want to rule this out as a cause, you can disable using the SetOaNoCache API.
If you still have an apparent leak after doing that, you can track it down using Process Dumper to get consecutive snapshots and then run it again to compare them. Run this against your Debug build if possible, as the callstacks are easier to decipher in that case.
精彩评论