[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: kdenetwork/librss
From:       David Faure <dfaure () trolltech ! com>
Date:       2003-06-17 13:42:10
[Download RAW message or body]

On Tuesday 17 June 2003 15:01, Frerich Raabe wrote:
> On Tuesday 17 June 2003 12:13, David Faure wrote:
> > On Tuesday 17 June 2003 02:44, Frerich Raabe wrote:
> > > Tobias' testcase probably gets easily fixed, just by doing something like
> > > "m_doc = doc;", read: creating a copy of the parsed Document instance
> > > which lives longer than the slot connected to the loadingComplete signal.
> >
> > Or m_image = doc.image() ? But since image() returns a pointer, this won't
> > work. I think it's a bit broken to use refcounting but to also declare that
> > the document is the parent of many things. One should be able to store only
> > the image, by value (to increase the refcount) and to forget about the
> > document, no?
> 
> Hm yes, I think having image() return a value might be a step in the right 
> direction, that way Image's refcount would get increased, and when the 
> Document goes out of scope it won't take the Image with itself. This is just 
> a little optimization though because then one stil has to do "Image img = 
> doc.image();", and then connect to "&img", so that a copy gets created. So 
> the basic "If you don't create a copy, it will get deleted RSN" problem is 
> still there.

But then it's very obvious from the code.
Of course if you connect to a temporary object you get trouble, that's not new :)

-- 
David FAURE, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic