Bug 157355

Summary: [PATCH] Memory leak, QSvgRenderers are created and never freed
Product: [Applications] kalzium Reporter: David Benjamin <davidben>
Component: generalAssignee: Kalzium Developers <kalzium>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Remove memory leak

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.

BUGS:157355,157359,157466,157473


 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