#include
using namespace std;
class X
{
public:
int a;
};
int main(void)
{
X *x = new X;
cout<
cout<
//delete x;
system("pause");
return 0;
}
linux 爆下面的错误
double free or corruption
windows直接爆异常
正确的写法
if (m_this)
{
delete m_this;
m_this = NULL;
}
摘自 工作记录--创造或收集原创