[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Array<T>::nil_rep leaks memory
From: |
Jaroslav Hajek |
Subject: |
Re: Array<T>::nil_rep leaks memory |
Date: |
Fri, 19 Sep 2008 10:35:13 +0200 |
On Fri, Sep 19, 2008 at 10:18 AM, David Bateman
<address@hidden> wrote:
> Jaroslav Hajek wrote:
>>
>> Hi,
>> in the function Array<T>::nil_rep a static pointer to an ArrayRep is
>> declared and allocated via new. Unless I'm mistaken, such a pointer is
>> never deleted and causes a memory leak. The attached patch fixes this
>> by using a static variable instead and returning its address.
>>
>> best,
>>
>>
>
> But nil_rep is only created once per Array<t> instantiation to represent the
> empty matrix. It should only be cleared when Octave quits.. So perhaps this
> isn't such a bug issue..
>
Yeah, but it still leaks, doesn't it? Leaking memory *is* a bug, IMHO.
> D.
>
>
> --
> David Bateman address@hidden
> Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les
> Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193
> Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
> The information contained in this communication has been classified as:
> [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola
> Confidential Proprietary
>
>
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz