Skip site navigation (1) Skip section navigation (2)

Re: possible memory leak in Server Status window

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Julius Tuskenis <julius(at)nsoft(dot)lt>, pgadmin-support(at)postgresql(dot)org
Subject: Re: possible memory leak in Server Status window
Date: 2011-02-12 22:56:37
Message-ID: 4D571025.6070302@lelarge.info (view raw or flat)
Thread:
Lists: pgadmin-support
Le 12/02/2011 15:22, Dave Page a écrit :
> On Sat, Feb 12, 2011 at 9:23 AM, Guillaume Lelarge
> <guillaume(at)lelarge(dot)info> wrote:
>> I know Peter and Dave talked about some stuff I actually didn't
>> understand, but it seems it would take some time to do. So, I prefer
>> having this simple and effective fix right now :)
> 
> :-)
> 
> We were talking about smart pointers - basically, instead of doing
> something like:
> 
> obj *foo = new obj();
> ...
> <many lines of code and exit points>
> ...
> delete foo;
> 
> You might do:
> 
> pg_smartptr<obj> foo;
> ...
> <many lines of code and exit points>
> ...
> 
> Note the lack of a delete - that's the point here; it's not needed
> because as soon as the smart pointer goes out of scope, it's
> destructor will delete foo. That means you don't have to remember to
> include the delete in each of the many exit points of the code.
> 

Yeah, that would be really interesting. And thanks for the explanation :)

> See also http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization
> 


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

In response to

pgadmin-support by date

Next:From: Maximilian TyrtaniaDate: 2011-02-14 12:05:43
Subject: large objects permission issue
Previous:From: Peter GeogheganDate: 2011-02-12 15:41:05
Subject: Re: possible memory leak in Server Status window

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group