c++ - How to free up heap memory created inside class -




i have class called "frame" has 2 member variables; 1 int , other void*. after instantiating frame, deallocate memory space created void* seems not clearing space. can please point me wrong code ?

  class frame {     public:      frame(int a)      {         = m_a;     }      frame(int a, void* b) {         = m_a;         b = m_b;     }     ~frame() { delete m_b; }     public:         int m_a;         void* m_b;     };   queue<frame*> q; size_t m_bufferbytes = 5606400;   int main(void) {     void* n = operator new(10000);     frame* f = new frame(1, n);      delete f->m_b;     delete f;      cout << "test\n";  return 0; } 





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -