我正在使用基于“WIN32 工具帮助功能”的内存监控库。
在其源代码中调用了 CreateToolhelp32Snapshot()
、Heap32ListFirst()
、Heap32ListNext()
和 CloseToolhelp32Snapshot( )
。
我的问题是相关的 windows 头文件中没有 CloseToolhelp32Snapshot() 的原型(prototype)。
我正在尝试为 Windows PC 平台编译(确切地说是 Win7,但我认为它与 XP 没有区别)。
我在网上搜索了一下,一些中国人说我必须在 PC 平台上使用 CloseHandle()
而另一些人说它会产生内存泄漏。
使用后如何正确关闭 handle ?
感谢您的帮助!
最佳答案
CreateToolhelp32Snapshot
的文档说:
To destroy the snapshot, use the CloseHandle function.
CloseToolhelp32Snapshot
似乎仅适用于 WinCE/Mobile。
关于c++ - 'CloseToolhelp32Snapshot' : identifier not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18019346/