N
nobrain
Release Version Only Problem..
this simple.. class include member variable CString,
make many object and free. but programe using memory
size is big and big..(only release version, debug version
is correct)
========exam code==============
#include <afxtempl.h>
class CObjublic CObject
{
public:
__int64 a,b,c,d,e,f,g,h;
CString sa,sb,sc,sd,se;
};
void TestFunc()
{
CTypedPtrArray<CPtrArray,CObj*> m_array;
CObj *p;
for (int i=0;i<120000;i++)
{
p=new CObj;
p->sa="123";
m_array.Add(p);
}
for (i=0;i<m_array.GetSize();i++)
delete m_array[m_array.GetSize()-i-1];
m_array.SetSize(0);
}
this simple.. class include member variable CString,
make many object and free. but programe using memory
size is big and big..(only release version, debug version
is correct)
========exam code==============
#include <afxtempl.h>
class CObjublic CObject
{
public:
__int64 a,b,c,d,e,f,g,h;
CString sa,sb,sc,sd,se;
};
void TestFunc()
{
CTypedPtrArray<CPtrArray,CObj*> m_array;
CObj *p;
for (int i=0;i<120000;i++)
{
p=new CObj;
p->sa="123";
m_array.Add(p);
}
for (i=0;i<m_array.GetSize();i++)
delete m_array[m_array.GetSize()-i-1];
m_array.SetSize(0);
}