I allocated a buffer in my app like below:
Qt Code:
  1. char* ptr = new char[variable]; // its has a variable size but this is known before calling this line
To copy to clipboard, switch view to plain text mode 

then i pass that pointer to my class

Qt Code:
  1. myClass* c = new myClass(ptr);
To copy to clipboard, switch view to plain text mode 

in my myClass constructor and destructor
Qt Code:
  1. myClass::myClass(char* ptr)
  2. {
  3. m_ptr = ptr; //m_ptr is a private char* pointer
  4. }
  5. myClass::~myClass
  6. {
  7. delete [] m_ptr;
  8. }
To copy to clipboard, switch view to plain text mode 

I expected this to free up the buffer everytime i deleted the object myClass but i was wrong. I am monitoring my app in task Manager and it is still using a lot of memory even after deleting myClass. please tell me where did i go wrong.

baray98