Now I implement a class and I need to use vector to hold some pointers.This is a global member. vector g_vIPControlCollection;
When the system finalize. I want to reclaim the memory. Then I define the destroy method.
void Destroy()
{
int size = g_vIPControlCollection.size();
if (size > 1)
{
for (int i = 0; i < size; i++)
{
g_vIPControlCollection[i]->Release();
}
}
g_vIPControlCollection.clear();
g_vIPControlCollection.~vector<IPersistorControl*>(); //Does this line is necessary?
}
My question is whether I need to call destructor of the vector? Thanks in advance. Your help will be greatly appreciated.