[Digikam-devel] I'm back with questions - AutoCorrections tool memory usage and resource leaks
Gilles Caulier
caulier.gilles at gmail.com
Wed Mar 3 13:01:41 GMT 2010
2010/3/3 Matthias Welwarsky <matze at welwarsky.de>:
> Hi Gilles,
>
> On Wednesday 03 March 2010 11:06:01 you wrote:
>> Hi Mathias,
>>
>> Yes, you have right. All recent changes in svn trunk come from me.
>> The deep copy refimage is not necessary here of course. it can be removed.
>
> OK, how would the code look like then?
>
> m_refImage = *refImage?
yes, it's look fine.
>
>>
>> > The second problem, which leads to
>> > the mem leak is the undefined lifetime of the effect filters, especially
>> > those in the PreviewList.
>> >
>> > The filter instances are never explicitely destroyed. They are either
>> > tied to the lifetime of the AutoCorrectionTool instance or the lifetime
>> > of the PreviewList. But the PreviewList is created and tied to the
>> > _parent_ object of the AutoCorrectionTool, which is unfortunately the
>> > ImagePlugin_Core instance, which has near infinite lifetime. I think you
>> > get the picture ;)
>>
>> What the real solution here ? To pass a widget object as parent
>> instead image_plugin core instance ?
>
> I tried that, by creating PreviewList as with "this" as the parent object, but
> I get a crash on application shutdown. For now my solution is to explicitly
> delete the PreviewList in the AutoCorrectionTool destructor. It's a bit
> strange, I thought that PreviewList would be destroyed together with
> AutoCorrectionTool due to the parent/child relation, but it's not the case, I
> see the AutoCorrectionTool destructor execute but not the PreviewList
> destructor. PreviewList is destructed on application shutdown only and there I
> get a crash.
>
It's not due to use deleteLater() ?
http://lxr.kde.org/source/extragear/graphics/digikam/utilities/imageeditor/widgets/previewlist.cpp#131
Gilles
More information about the Digikam-devel
mailing list