Original Post
Hello everyone, i have a question: I'm currently making a list class which is containing the following vector: private: static std::vector* m_COPtrVectorPtr ; //i have a method/member function that adds a new ControlObject as follows: void COList::Add() { m_COPtrVectorPtr->push_back(new ControlObject()); } Now my question is about the destructor of the class, which i have here: COList::~COList() { //anything before this? if (m_COPtrVectorPtr!=0) delete m_COPtrVectorPtr; } Since this is a vector which contains pointers to other objects i was wondering that when i call this destructor/delete an object of the class i'm writing, does the vector handle its own destruction without memory leaks? Does it delete the objects and frees up the memory to which its pointers are leading? If not, how do i do this correctly? Thanks in advance and friendly greetings, pundit ^^