最近用VC2010在使用ICE的过程中,发现调试有内漏,曾经在VC6的年代用过ICE确实也有过这问题。官方有过一个比较确切的说法:
转自:http://www.zeroc.com/faq/mfcLeakDetector.html
Why does the MFC leak detector report memory leaks with Ice?
When running a debug version of an MFC application that links with the Ice libraries, after the application terminates, you may see something similar to the following in the IDE debug window:
Detected memory leaks! Dumping objects -> {77} normal block at 0x00475768, 16 bytes long. Data: < WG hWG > 18 57 47 00 68 57 47 00 00 00 00 00 00 00 00 00 {75} normal block at 0x00475A90, 1808 bytes long. Data: <0123456789ABCDEF> 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 {74} normal block at 0x00472FE0, 28 bytes long ...
We have tested the Ice run time extensively and are confident that it does not harbor memory leaks—even when MFC is used. The erroneous leak reports are caused by the use of static variables in the Ice libraries, such as instances of std::string. These instances allocate memory when they are constructed, but have not released the memory at the time the Microsoft memory tracker runs its leak detection routines. This is annoying and, unfortunately, there is no known solution to this problem.
Of course, it is always possible that your application has real memory leaks, so it is best to use a leak detector to help track down such bugs. However, we recommend that you ignore the output from the Microsoft memory tracker and instead use a leak detector that does not suffer from this problem, such as Rational Purify.
有时间真的要拿Purify进行内漏检测看看。