Log in

View Full Version : C++ what happens when don't delete an object?



Trinithis
09-25-2007, 10:41 PM
What happens when you forget to delete an object in C++ and the program terminates? I assume the memory is freed, but I don't know.

Mr Moo
09-26-2007, 12:34 AM
It depends on the OS and the C lib being used. In most cases, with modern OS's your memory will be freed, but with some older OS's it may not. Certainly, while your app is running the memory will not be freed and, depending on how much you use, you could cause an OS crash.