应用程序在关闭时崩溃,视图被破坏了两次 [英] app crash on close, view is destroyed twice

查看:67
本文介绍了应用程序在关闭时崩溃,视图被破坏了两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序关闭是由于视图双重破坏导致的内存堆损坏.

我的应用程序使用拆分器,其中某些视图在框架上的oncreateclient方法中加载,我认为这会干扰正常的mfc文档视图架构工作流程.

我试图在我的应用程序和mfc内进行调试,以了解为什么两次破坏了我的视图,但我不明白.我敢肯定,我不会从我的应用程序中销毁它们,而这种双重销毁是通过mfc完成的.

谁能给我一个建议?

谢谢.

My app crash on close because of a memory heap corruption due to view double destruction.

My app use a splitter with some views loaded at oncreateclient method on frame and I think it interfere with normal mfc document view architecture workflow.

I tryed to debug inside my app and inside mfc in order to understand why my views are destroyed twice but I didn''t understand. One thing I''m sure, I''m not destroying them from my app, this double destroying is done from mfc.

Can anyone give me a suggestion?

Thank you.

推荐答案

我建​​议在MFC CView ::〜CView函数中放置一个断点,看看双重破坏来自何处.
请注意,通常使用
在OnDestroy成员函数中销毁视图.
I would suggest to put a breakpoint in the MFC CView::~CView function and see, where the double destroy comes from.

Note that views are normally destroyed in the OnDestroy member function with

delete this;


这篇关于应用程序在关闭时崩溃,视图被破坏了两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆