帮我记忆泄漏 [英] help me memory leaks

查看:70
本文介绍了帮我记忆泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

检测到内存泄漏!
转储对象->
{850}正常块,位于0x01363F28,长16个字节.
数据:< > CD CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
对象转储完成.

我有一个源自CDialog
的基类CCommonDlg 然后让CRegesterDlg 来自CCommonDlg
然后让CEditUserDlg 来自CRegesterDlg
当我写这个

Detected memory leaks!
Dumping objects ->
{850} normal block at 0x01363F28, 16 bytes long.
Data: < > CD CD CD CD 00 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.

I have a base class CCommonDlg derived from CDialog
then let CRegesterDlg derived from CCommonDlg
then let CEditUserDlg derived from CRegesterDlg
when I write this

m_pEditUser = new CEditUserDlg;
m_pEditUser->Create(CRegesterDlg::IDD,this);
m_pEditUser->SetUserInfo(&m_stUserInfo);

内存泄漏!
为什么?

The memory leaks!
why ?

推荐答案

大约有16个字节长,已分配,并且可能从未初始化过int从未删除的前4个字节.

这是我们唯一可以从您的帖子中得出的结论.
There is something 16 bytes long, that was allocated and presumably never initialized int the first 4 bytes that have never been deleted.

This is the only thing we can deduce from your post.


购买内存泄漏查找工具.有几种可用的方法.
Buy a memory leak finder tool. There are several available.


您可以使m_pEditUser不是指针,而是堆栈变量吗?然后,您无需使用new创建它,而担心删除它.
Can you make m_pEditUser be not a pointer, but a stack variable? Then you would not need to create it with new and worry about deleting it.


这篇关于帮我记忆泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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