|
Might be fine for a program that always runs in its own job, starts, does some work, and ends, but for anything that may run frequently in an interactive job or a long-running batch server type job this is just asking for trouble. Memory leaks abound in code with plenty of storage available and eventually they cause problems.
I'm fairly sure you know that but there are others who might consider this lazy way an acceptable one.
Pointers are like farm gates: if you open (allocate) it you should close (deallocate) it. If it's already open leave it open. With pointers however, there are some sloppy functions that return an allocated pointer and expect the caller to deallocate so it's more of a guideline than a rule but the point (hardeharhar) is obvious.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.