MFC对话框中new创建CStatic()控件回收时出现内存泄漏

CStatic *outshow[500];
#pragma region 参数显示控件
    for(int i = 0; i < 500; i++)
    {  
        outshow[i] = new CStatic(); 
        outshow[i]->Create(_T("00000"), WS_CHILD|SS_LEFT,CRect(0,0,46,15),this,10000+i);
        //10000~~~~10499个STATIC控件
    }
回收:
void CfmudemoDlg::deleteResource()
{
for(int i = 0; i < 500; i++)
    {   delete outshow[i];  outshow[i] = NULL;  }
//delete[] outshow;

代码如上,确定执行完回收数组里全部都是0x0000000,但是每次还是会出内存泄漏不超过十个:
Detected memory leaks!
Dumping objects ->
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp(306) : {1706} client block at 0x15BE0008, subtype c0, 68 bytes long.
a CWinThread object at $15BE0008, 68 bytes long
h:\project 176\test\test\fmudemo\fmudemodlg.cpp(585) : {833} client block at 0x15BBA550, subtype c0, 116 bytes long.
a CStatic object at $15BBA550, 116 bytes long
h:\project 176\test\test\fmudemo\fmudemodlg.cpp(585) : {832} client block at 0x15BBA4A0, subtype c0, 116 bytes long.
a CStatic object at $15BBA4A0, 116 bytes long
h:\project 176\test\test\fmudemo\fmudemodlg.cpp(585) : {831} client block at 0x15BBA3F0, subtype c0, 116 bytes long.
a CStatic object at $15BBA3F0, 116 bytes long
h:\project 176\test\test\fmudemo\fmudemodlg.cpp(585) : {830} client block at 0x15BBA340, subtype c0, 116 bytes long.
a CStatic object at $15BBA340, 116 bytes long
h:\project 176\test\test\fmudemo\fmudemodlg.cpp(585) : {829} client block at 0x15BBA290, subtype c0, 116 bytes long.
a CStatic object at $15BBA290, 116 bytes long
h:\project 176\test\test\fmudemo\fmudemodlg.cpp(585) : {828} client block at 0x15BBA1E0, subtype c0, 116 bytes long.
a CStatic object at $15BBA1E0, 116 bytes long
h:\project 176\test\test\fmudemo\fmudemodlg.cpp(585) : {827} client block at 0x15BBA130, subtype c0, 116 bytes long.
a CStatic object at $15BBA130, 116 bytes long
Object dump complete.
我想知道这是什么情况,我回收的姿势是不是有错。。。还有为什么一调delete[] outshow;就会中断呢?
求大神解答

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值