why release memmory?

Started by
11 comments, last by kroiz 22 years, 5 months ago
Well, if you set them to NULL you can easily check later if you have memory allocated or not.
Advertisement
Calling delete on a NULL pointer is guaranteed to fail gracefully, eg do nothing at all. If you call delete on a pointer, fail to set it to NULL, and try to delete the same pointer once more, lots of bad and mysterious things can and will happen.
Personally I believe garbage collection is the future for all but the most time critical programs. I''m also getting a little tired of that silly l33ter-than-thou-because-I-manage-my-own-memory attitude.

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours." - - Stephen Roberts
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Another reason to relase the memory is so that you can use the same physical memory again and again, instead of always asking for more when you need it.
-- Succinct(Don't listen to me)

This topic is closed to new replies.

Advertisement