After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652257 - Memory leak in gnc-file.c
Memory leak in gnc-file.c
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Engine
git-master
Other Linux
: Normal major
: ---
Assigned To: Derek Atkins
Christian Stimming
Depends on:
Blocks:
 
 
Reported: 2011-06-10 07:05 UTC by Tim M
Modified: 2018-06-29 22:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the memory leak. (404 bytes, patch)
2011-06-10 07:05 UTC, Tim M
committed Details | Review

Description Tim M 2011-06-10 07:05:17 UTC
Created attachment 189600 [details] [review]
Patch to fix the memory leak.

I found a memory leak in gnc-file.c.

In gnc_file_quit(), gnc_get_current_session() is called a second time for seemingly no purpose. This results in a large number of errors reported by valgrind due to memory leaks.

Removing this call dropped the "possibly lost" and "definitely lost" memory errors reported by valgrind from 12,873 to 10,868.

These were the # of errors reported for simply launching and then closing the app (with a very, very basic gnucash XML file opened by default containing default accounts and only a couple transactions).


The patch does not cause GnuCash to crash nor does it _seem_ to cause any problems, but it has not been tested extensively.

I was researching https://bugzilla.gnome.org/show_bug.cgi?id=431324 when I ran into this, but the original defect still seems to occur so I am logging this as a separate issue.  There are many more errors reported by valgrind so it may take some time to figure out exactly what is causing #431324.

Thanks,
-Tim
Comment 1 Geert Janssens 2011-06-21 12:21:16 UTC
Comment on attachment 189600 [details] [review]
Patch to fix the memory leak.

Committed in r20792 (trunk) and r20793 (2.4x.). Thanks a lot !
Comment 2 Geert Janssens 2011-06-21 12:21:42 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 3 John Ralls 2018-06-29 22:59:01 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=652257. Please update any external references or bookmarks.