现在我的程序运行一段时间后出现下面的错误,不知道是哪里的原因!
Runtime error!
This application has requested the runtime to terminate it in an unusual way.
这是release版的。如果是debug版的,则会出现debug error的错误。实在是不知道啊!!还有程序运行一段时间后还会出现虚拟内存太低的错误,然后程序就自动退出!但是也没有显示内存泄漏阿!???
Runtime error!
This application has requested the runtime to terminate it in an unusual way.
这是release版的。如果是debug版的,则会出现debug error的错误。实在是不知道啊!!还有程序运行一段时间后还会出现虚拟内存太低的错误,然后程序就自动退出!但是也没有显示内存泄漏阿!???
而且你说的现象就是内存泄露
上面微软的网站里倒是说这个错误了,不过他说vc 6.0的程序在XP下可能会出现上面的错误。但是我的是net 2003+xp+sp2下写的程序在2000下出的问题,怪!
用BoundsChecker就不能查出来这种问题:vector<int *> vpInt;
int *g_pint = NULL;
函数A中初始化
g_pint = new int;
vpInt.push_back(g_pint);函数B中使用
g_pint = new int;
g_pint = vpInt.pop_back(g_pint);函数C中结束
if (g_pint)
{
delete g_pint;
g_pint = NULL;
}
g_pint = vpInt.pop_back();
g_pint = new int;
g_pint = vpInt.pop_back(g_pint);g_pint不应该再new了,去掉g_pint = new int;
或者AfxMessageBox("1")...("2")...然后运行,看看到哪一步出错。
或者写日志。