|
-
February 8th, 2009, 12:10 PM
#1
[RESOLVED] exit(): memory leaks?
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
- Buzzyous -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|