[Kde-pim] Grantlee version 0.1.5 now available

Janne Hakonen joyer83 at live.fi
Sun Aug 29 12:32:21 BST 2010


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.

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.

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().

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/
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filter1.patch
Type: application/octet-stream
Size: 1522 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100829/48866cf1/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filter2.patch
Type: application/octet-stream
Size: 2180 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100829/48866cf1/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filter3.patch
Type: application/octet-stream
Size: 2806 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100829/48866cf1/attachment-0002.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