SAConnection* con=new SAConnection;
delete con;在delete con时会,弹出窗口
Windows has triggered a breakpoint in Test.exe.
This may be due to a corruption of the heap, which indicates a bug in Test.exe or any of the DLLs it has loaded.
不知道为什么?
delete con;在delete con时会,弹出窗口
Windows has triggered a breakpoint in Test.exe.
This may be due to a corruption of the heap, which indicates a bug in Test.exe or any of the DLLs it has loaded.
不知道为什么?
不过现在解决了,把SAConnection作为成员封装到了一个类中
clsaa SAConnectionWrapper
{
public:
SAConnection* GetCon() const;
private:
SAConnection m_con;
};SAConnectionWrapper* conWrapper=new SAConnectionWrapper;
delete conWrapper;
正常了。