Bug 157355 - [PATCH] Memory leak, QSvgRenderers are created and never freed
Summary: [PATCH] Memory leak, QSvgRenderers are created and never freed
Alias: None
Product: kalzium
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Kalzium Developers
Depends on:
Reported: 2008-02-07 19:17 UTC by David Benjamin
Modified: 2008-02-09 15:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:

Remove memory leak (2.20 KB, patch)
2008-02-07 19:20 UTC, David Benjamin

Note You need to log in before you can comment on or make changes to this bug.
Description David Benjamin 2008-02-07 19:17:50 UTC
Version:           1.9.91 (using KDE 4.0.0)
Installed from:    Compiled From Sources
OS:                Linux

Steps to Reproduce:
1. Switch to icon mode (so you get the pretty pictures :-D)
2. Have the sidebar show the larger version
3. Move your mouse over the different elements.
4. Watch your memory usage gradually increase as the pictures change.

Patch attached below.
Comment 1 David Benjamin 2008-02-07 19:20:23 UTC
Created attachment 23464 [details]
Remove memory leak

This patch removes the memory leak. The QSvgRenderer is short-lived, so might
as well allocate it on the stack.

(Also a couple minor things like the static QFile::exists(QString) instead of
creating an object. It seems to go via QFileInfo, which I presume stat()s the
file. And endsWith instead of the regexp which had a minor problem with . being
a wildcard anyway.)
Comment 2 cniehaus 2008-02-09 15:25:37 UTC
SVN commit 772723 by cniehaus:

Fix four bugs. All patches have been provided by David Benjamin.


 M  +8 -5      detailedgraphicaloverview.cpp  
 M  +4 -2      detailinfodlg.cpp  
 M  +1 -1      kalzium.cpp  
 M  +3 -5      kalziumdataobject.cpp  
 M  +1 -2      molcalcwidget.cpp  
 M  +2 -31     molcalcwidgetbase.ui  

WebSVN link: http://websvn.kde.org/?view=rev&revision=772723