Quantcast
Viewing latest article 3
Browse Latest Browse All 4

Answer by Björn Pollex for How does "delete" reclaim memory?

The destructor is responsible for clearing up all the resources an object owns. That includes calling delete on pointers that require it. If your destructor does not do this, then you will get a memory leak.

If your objects has members with automatic storage duration, then the destructors of those members are called automatically. This is the foundation of RAII.


Viewing latest article 3
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>