在“删除 CDocManager::pStaticDocManager;”中出现错误
运行以下代码时,
if (CDocManager::pStaticDocManager != NULL)
{
delete CDocManager::pStaticDocManager;
CDocManager::pStaticDocManager = NULL;
}
删除语句中出现异常“ChinaEncrypter.exe 中 0x0041f09d 处的未处理异常:0xC0000005:访问冲突读取位置 0x00003130”。
*注意:*此错误仅在发布模式下出现,并且 pStaticDocManager 仅在发布模式下初始化。在调试模式下,它在整个过程中具有 NULL 值。
提前致谢。
While running following code
if (CDocManager::pStaticDocManager != NULL)
{
delete CDocManager::pStaticDocManager;
CDocManager::pStaticDocManager = NULL;
}
exception "Unhandled exception at 0x0041f09d in ChinaEncrypter.exe: 0xC0000005: Access violation reading location 0x00003130" is coming in delete statement.
*Note:*This error is coming only in release mode and pStaticDocManager is initialising only in release mode. In debug mode it is having NULL value during whole process.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否显式将 pStaticDocManager 初始化为 NULL ?
还要确保 pStaticDocManager 指向的实例已正确初始化其所有成员。
Did you explicit initialize pStaticDocManager to NULL ?
Also make sure the instance pointed by pStaticDocManager have all its member correctly initialized.