From kde-commits Tue Jun 17 13:01:10 2003 From: Frerich Raabe Date: Tue, 17 Jun 2003 13:01:10 +0000 To: kde-commits Subject: Re: kdenetwork/librss X-MARC-Message: https://marc.info/?l=kde-commits&m=105585488709562 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. - Frerich -- "Irgendwie haben die Leute das mit der Meinungsfreiheit falsch verstanden, man darf eine Meinung haben, man muss nicht. Wenn man keine Ahnung hat, einfach mal Fresse halten."