destructor
n.n. a person or thing that destroys something. In computer programming, it is a special instruction that cleans up data when it is no longer needed.
n. an agent or instrument that causes destruction. In object-oriented programming, refers to a specific method invoked to deallocate resources and perform cleanup when an object's lifetime ends.
The software uses a destructor to free up memory.
The architect was seen as a destructor of local heritage after he proposed tearing down the historic clock tower.
In languages like C++, the destructor is essential for preventing memory leaks, as it ensures that any dynamically allocated memory is released once the object goes out of scope.
In its technical sense, it is frequently contrasted with a 'constructor'.
Last updated July 22, 2026