[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Array<T>::nil_rep leaks memory
From: |
John W. Eaton |
Subject: |
Re: Array<T>::nil_rep leaks memory |
Date: |
Tue, 23 Sep 2008 09:11:56 -0400 |
On 23-Sep-2008, Jaroslav Hajek wrote:
| Well, as much as I understand it, the static object will be correctly
| deallocated at the end of the program, while the new-allocated object
| (on heap, presumably) is *never* freed. It's not much of an issue, but
| it is a memory leak.
If that were true, then repeatedly running a program like
int main (void) { char *x = new char [134217728]; return 0; }
would quickly make your system unusable. But it does not, as the
resources allocated to the program are freed when the program exits.
jwe