[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] exceptions and the heap.

From: Gaius Mulley
Subject: Re: [Gm2] exceptions and the heap.
Date: Wed, 25 Nov 2009 14:45:01 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Martin Kalbfuß <address@hidden> writes:

> Hi,
> What happens to the allocated memory when an uncaught exception halts
> the program? Do I need to catch the exception in every function which
> allocates memory, free that memory and rethrow the exception? Or is the
> memory automatically freed?
> Thanks,

Hi Martin,

No it shouldn't be necessary - for normal programs all memory
allocated (Storage / malloc) will be deallocated when a program calls
exit (under Linux, Unix etc).  Unless you are using mmap or other
persistent resource allocation,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]