DLL 中new了一个字符串,调用PostMessage发送给主程序,主程序处理了数据后delete
当主程序和dll都用vs2010编译(v100)时,不会崩溃,
当主程序和dll都用vs2017编译(v141)时,也不会崩溃,
当主程序用vs2010编译(v100),dll用vs2017编译(v141)时,就会崩溃,
出错的地方:
_ASSERTE(_CrtIsValidHeapPointer(pUserData));
注释:
- If this ASSERT fails, a bad pointer has been passed in. It may be
- totally bogus, or it may have been allocated from another heap.
- The pointer MUST come from the 'local' heap.
好像是说delete的指针不是本地堆内存