这是我的代码。
vector<Employee*> theEmployee;
...
virtual ~Personal()
{
for (vector<Employee*>::iterator it = theEmployee.begin(); it != theEmployee.end(); it++)
{
delete(*it); <---the line of that error
}
}
我试图通过添加if (*it != NULL)
来解决此问题,但这没用。