Review Request: Big memory leaks are gone

Albert Astals Cid tsdgeos at terra.es
Tue Jul 19 22:59:51 CEST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102009/#review4872
-----------------------------------------------------------



lib/DictEdict/entryedict.cpp
<http://git.reviewboard.kde.org/r/102009/#comment4227>

    You do not need this either, the default destructor of EntryEdict will destruct the QStringLists and clear them



lib/DictEdict/entryedict.cpp
<http://git.reviewboard.kde.org/r/102009/#comment4229>

    Meanings is a QStringList, you do not need to clear it before assining it.



lib/DictKanjidic/entrykanjidic.h
<http://git.reviewboard.kde.org/r/102009/#comment4233>

    You do not need to declare empty destructors for non leaf classes



lib/entrylist.cpp
<http://git.reviewboard.kde.org/r/102009/#comment4226>

    I'm unsure this does anything. EntryList seems to be a QList<Entry*> and clear will not delete the Entry* contained on the list, so clear basically does nothing that the destructor was not already doing



radselect/buttongrid.cpp
<http://git.reviewboard.kde.org/r/102009/#comment4234>

    I don't see how changing this from a local variable to a class variable does anything.


- Albert


On July 19, 2011, 4:12 p.m., Jaime Torres Amate wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102009/
> -----------------------------------------------------------
> 
> (Updated July 19, 2011, 4:12 p.m.)
> 
> 
> Review request for KDE Edu.
> 
> 
> Summary
> -------
> 
> Remove the big memory leaks that the bug talks about.
> In the path to the resolution, some virtual destructors were added, 
> a class member for the radical map, and
> the use of clear(). Without it, the list items destructors where not called (at least the kDebug that I enabled did not wrote anything).
> And finally, the delete before nullify the pointer and the delete where the pointer is not added to the list.
> 
> 
> This addresses bug 275047.
>     http://bugs.kde.org/show_bug.cgi?id=275047
> 
> 
> Diffs
> -----
> 
>   app/kiten.cpp b403da3 
>   lib/DictEdict/dictfileedict.h 3916149 
>   lib/DictEdict/dictfileedict.cpp f24a492 
>   lib/DictEdict/entryedict.h f7eeb62 
>   lib/DictEdict/entryedict.cpp 6dbedf5 
>   lib/DictKanjidic/dictfilekanjidic.h 49eed7f 
>   lib/DictKanjidic/dictfilekanjidic.cpp 318890b 
>   lib/DictKanjidic/entrykanjidic.h 9df84f9 
>   lib/DictKanjidic/entrykanjidic.cpp 8d0540b 
>   lib/entrylist.cpp 002e873 
>   radselect/buttongrid.h 2e5c1d7 
>   radselect/buttongrid.cpp 51e5e54 
> 
> Diff: http://git.reviewboard.kde.org/r/102009/diff
> 
> 
> Testing
> -------
> 
> Run kiten under valgrind. The big memory leaks are gone. There are now only Qt, fontconfig and kdelibs leaks.
> 
> 
> Thanks,
> 
> Jaime Torres
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-edu/attachments/20110719/c2f32b75/attachment.htm 


More information about the kde-edu mailing list