I built a pointer based class, that makes a lot of use of dynamic memory allocation with new. So I equipped the class with an appropriate destructor, that traces back all allocated objects and deletes them.

The problem is: if in some point of my application I use exit() or _exit() to abruptly terminate the app in response to an invalid capital operation of the user, the destructor is never called; does the memory that my classes have allocated get deallocated in the exit() routine? I use a lot of new, so if memory does not get correctly deallocated I fear some system memory shortage if the app is launched and closed with exit more than once...

Is exit() to be avoided in these cases?

Thanks in advance