[Kde-pim] Grantlee version 0.1.5 now available

Janne Hakonen joyer83 at live.fi
Wed Sep 1 17:46:53 BST 2010


Hi,

I found how to introduce the leaks to testscriptabletags.cpp. See the 
attached patch file.
Basically, just add the the "scripteddefaults" library to list of default 
libraries. You can then remove all the load-tags from tested templates as 
they are not needed anymore, but the leaks came up were the load-tags in 
place or not.
This is also the way I'm loading those qs-libraries in my application.

- Janne

--------------------------------------------------
From: "Janne Hakonen" <joyer83 at live.fi>
Sent: Monday, August 30, 2010 6:53 PM
To: "KDE PIM" <kde-pim at kde.org>
Subject: Re: [Kde-pim] Grantlee version 0.1.5 now available

> I'm sorry, but the fix didn't have any effect. Objects created from
> ScriptableNodeFactory and ScriptableFilter are not deleted. Or rather, at
> least in ScriptableFilter's case they are deleted sometimes. I put
> breakpoints to ScriptableFilter's constructor and destructor, the
> constructor was hit 184 times and destructor was hit 92 times.
>
> Further investigation:
> It looks like the filters are created in two slightly different ways. The
> difference is in Parser's constructor where they are created as a result 
> of
> calling Engine's loadDefaultLibraries(). They are also created when the
> constructor calls Engine's loadLibrary() in a Q_FOREACH loop couple of 
> lines
> below.
>
> I'm guessing that when you call loadDefaultLibraries() it loads the
> libraries and their filters. The filters are stored as raw pointers into
> ScriptableLibraryContainer, and its pointer is returned, but
> loadDefaultLibraries() doesn't save it anywhere. <-- who should handle the
> filters' deletion in this case?
>
> When a library is loaded in Parser's Q_FOREACH loop, its pointer is passed
> to openLibrary() method which then takes the raw filters' pointers and
> stores them as QSharedPointers which seems to delete the filters correctly
> when they are not needed anymore.
>
> -Janne
>
> --------------------------------------------------
> From: "Stephen Kelly" <steveire at gmail.com>
> Sent: Sunday, August 29, 2010 9:29 PM
> To: <kde-pim at kde.org>
> Subject: Re: [Kde-pim] Grantlee version 0.1.5 now available
>
>> Janne Hakonen wrote:
>>
>>> Thanks! Your change has corrected the memory releasing problem mostly.
>>> It's still taking about ~200kB more memory after each template run, but
>>> previously it took a bit over 10Mb of memory on each run, so a definite
>>> improvement. Frankly, this is already quite acceptable for my needs. :)
>>>
>>> The leak detector is still showing those leaks, so they might be cause 
>>> of
>>> that small memory take.
>>> I've included debug output from my application which includes the
>>> detector's report.
>>>
>>> Janne
>>
>> Probably fixed now. could you try again?
>>
>>
>>
>> _______________________________________________
>> KDE PIM mailing list kde-pim at kde.org
>> https://mail.kde.org/mailman/listinfo/kde-pim
>> KDE PIM home page at http://pim.kde.org/
>>
> _______________________________________________
> KDE PIM mailing list kde-pim at kde.org
> https://mail.kde.org/mailman/listinfo/kde-pim
> KDE PIM home page at http://pim.kde.org/
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testscriptabletags.cpp.patch
Type: application/octet-stream
Size: 5119 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100901/855165d2/attachment.obj>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list