CPtrList m_LineList;  // 定义在CView中有个类CLineManager,程序中通过以下添加到队列中:CLineManager *n=new CLineManager(m_FirstPoint,m_SecondPoint,RGB(0,0,0));
m_LineList.AddTail(n);问题时,在释放对象时,我是这样处理的:
CSecond2010View::~CSecond2010View()
{
POSITION pos;
CLineManager *temp;
pos=m_LineList.GetHeadPosition();
while(pos)
{
temp=(CLineManager *)m_LineList.GetNext(pos);
delete temp;
}
m_LineList.RemoveAll();
}
我的问题是:如果只使用m_LineList.RemoveAll();能将队列里面的对象一一释放吗?