[Kde-pim] Grantlee version 0.1.5 now available

Stephen Kelly steveire at gmail.com
Sun Aug 29 16:42:33 BST 2010


Janne Hakonen wrote:

> Hi,
> 
> I'm sorry, but I got bundle of problems for you again.
> 
> The core library - build with VS2008 - crashes application that uses it.
> The cause of failure is at line 80 of corelib/filterexpression.cpp.
> I can't find what the problem is, but it has something to do with the
> constantString constant. If you attempt to use it as part of the
> filterRawString constant, it will compile just fine, but crashes when
> application is ran.
> I tried three different modifications which all work:
> filter1.patch: Change constantString's type to QString, either by removing
> the preprocessor stuff and just leave the QString type or change the Qt
> version to something like 0x050600.
> filter2.patch: Turn the constantString to #define.
> filter3.patch: Remove constantString altogether and just replace
> constantString variables in filterRawString with constantString's content.

Should be fixed now. I went with option 1.

> 
> Another problem:
> When Grantlee::Engine's loadByName() method is called to execute a
> template it doesn't release memory after execution returns back to caller.
> If application that uses Grantlee executes enough templates it will run
> out of memory. You can see the problem in effect if you put doTest() call
> in tests/testscriptabletags.cpp on line 49 to inside forever { } -loop and
> also add a 1 second sleep to the loop. When executing the test
> application, observe the app's memory usage.
> 
> Only workaround I have found is to delete the Grantlee::Engine object
> after each template call. This correctly releases the memory.

Should be fixed now. The issue only affected users of the scriptable tags 
and was due to new-ing objects related to scripting on every template 
creation, even when not necessary.

> 
> Thirdly, there is two memory leaks, both in
> scriptabletags/scriptabletags.cpp:
> line 162: a new ScriptableNodeFactory object is created but not deleted
> anywhere,
> line 180: a new ScriptableFilter object is created but not deleted
> anywhere, Found these with Visual Leak Detector (http://vld.codeplex.com/)
> while attempting to figure out the memory usage problem with loadByName().

Could be fixed as a result of the above. Valgrind doesn't find the issue you 
mention at least, and from looking at the code it should not be a leak.

Could you try again with the tip of the 0.1 branch and let me know if you 
still experience any of these issues? I can make a new release next week 
then.

All the best,

Steve.

> 
> Thanks,
> Janne
> 
> --------------------------------------------------
> From: "Stephen Kelly" <steveire at gmail.com>
> Sent: Friday, August 27, 2010 12:58 PM
> To: <kde-pim at kde.org>
> Subject: [Kde-pim] Grantlee version 0.1.5 now available
> 
>> The Grantlee community is pleased to announce the availability of
>> Grantlee version 0.1.5[1].
>>
>> Grantlee is a Free Software string template library written in Qt and
>> based on the syntax and design of the Django template system[2].
>>
>> This is a patch release featuring the following changes:
>>
>>
>> * Make it possible to implement template tags in a re-entrant way.
>> * Make compiled Template objects cacheable
>> * Make it possible for the scripted filters to inject QObjects and arrays
>> to
>> scripts.
>> * More code maintainability improvements.
>> * Build Grantlee properly in release mode on Windows
>> * Make Grantlee buiild against Qt 4.5 (regression since v0.1.4)
>> * Several release system improvements
>>
>>
>> Grantlee uses an open git repository for development. Patches can be
>> submitted through gitorious[3].
>>
>> ----
>> [1] http://downloads.grantlee.org
>> [2] http://docs.djangoproject.com/en/dev/topics/templates/
>> [3] http://gitorious.org/grantlee
>>
>> _______________________________________________
>> 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/



More information about the kde-pim mailing list