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;就会中断呢?
求大神解答

猜你喜欢

转载自blog.csdn.net/qq_26676945/article/details/81610765