Re: how to release memory?



I also have a few doubts with regard to releasing memory and other
resources. When an error occurs at some point in the program then
usually we proceed by printing an error message and propogating a flag
backwards ( return (1) ) indicating error. Is it a good policy to
release all the resources which were held up till then (when the error
occured) in the program. For eg. a file may be open which must be
closed, a data structure that must be freed etc. It can vary at
different points in the program, different resources may have to be
freed depending on what was allocated till that point. At the very end
(just before main process ends) all the resources can be freed.


.



Relevant Pages

  • Re: A PE resource directory -- difficulty in understanding it ...
    ... *another files* resources, and I could not find anything ... in that regard. ... All you need is the HMODULE handle for the other file. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Who owns the worlds natural resources?
    ... >The truth of the matter is that no one owns any resources. ... >to the land is uniform for the purposes of this debate. ... >One claimant is a thriving, free market democracy; ... i regard it as an error to attribute *any* legitimacy to ...
    (uk.politics.misc)
  • Re: E-mail Server
    ... however I ask that you guys will point me to resources on the internet ... that may help me in this regard. ... Use Centos, not Fedora, for this project. ...
    (Fedora)
  • Re: Proper use of #getImageBlock in runtime
    ... actually I'm trying to locate resources in an uniform way in runtime ... some advice to this regard please tell me. ... image index instead of an image. ...
    (comp.lang.smalltalk.dolphin)
  • Re: resource management, which data structure / algorithm ?
    ... resources are refered to to by filename, ... resources are loaded if they are not already in memory ... But you mentioned data structure or algorithm. ...
    (comp.games.development.programming.algorithms)