Summary: | kstars is a memory hog | ||
---|---|---|---|
Product: | [Applications] kstars | Reporter: | Rolf Offermanns <rolf.offermanns> |
Component: | general | Assignee: | kstars |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | fix for some memory leakage |
Description
Rolf Offermanns
2003-10-03 12:58:40 UTC
Thank you very much for the report. I have confirmed that memory usage increases while KStars is running. Looks like we've got a leak. I really appreciate your bringing this to our attention. If you have experience with kcachegrind, you could help us try to track it down, if you want. Otherwise, watch this space for updates. thanks again, Jason Created attachment 2678 [details]
fix for some memory leakage
I don't have experience with kcachegrind. However, I wanted to try it for some
time, so why not now! :)
I run valgrind on kstars (which is unfortunately nearly to much for my system),
and it showed two places of potential memory leaks. Please see the attached
patch, I don't know if this is the right place to fix it, but it seems OK for
me.
Subject: kdeedu/kstars/kstars CVS commit by harris: Fixed bug #65413, regarding memory leaks. The reporter not only let us know about the problem, but also diagnosed it with valgrind, and kindly provided a patch that fixed four memory leaks. Each case was a missing 'delete' command when 'new' had been called. Thanks for the help, Rolf! CCMAIL: 65413-done@bugs.kde.org CCMAIL: kstars-devel@kde.org M +11 -6 kstarsdata.cpp 1.98 M +2 -0 ksutils.cpp 1.16 --- kdeedu/kstars/kstars/kstarsdata.cpp #1.97:1.98 @@ -325,6 +325,8 @@ while ( (c = (char) file.getch()) != -1) // Get host name ap = findXMLAtt(root, "name"); - if (!ap) + if (!ap) { + delLilXML(xmlParser); return false; + } INDIHostsInfo *VInfo = new INDIHostsInfo; @@ -335,7 +337,8 @@ while ( (c = (char) file.getch()) != -1) ap = findXMLAtt(root, "hostname"); - if (!ap) + if (!ap) { + delLilXML(xmlParser); return false; - + } VInfo->hostname = QString(ap->valu); @@ -343,6 +346,8 @@ while ( (c = (char) file.getch()) != -1) ap = findXMLAtt(root, "port"); - if (!ap) + if (!ap) { + delLilXML(xmlParser); return false; + } VInfo->portnumber = QString(ap->valu); --- kdeedu/kstars/kstars/ksutils.cpp #1.15:1.16 @@ -180,4 +180,6 @@ dms KSUtils::GSTat0hUT( const QDateTime gst.setH( t1 ); + delete num; + return gst.reduce(); } |