-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory leaks #367
Fix memory leaks #367
Conversation
In the first commit there is not only a memory leaked fixed. Can you update the commit message describing what it does please? |
The local and global variable called history_type is a static string. mate-power-manager/src/gpm-statistics.c Line 46 in 1308a5b
|
d09a320
to
a32c45a
Compare
@mbkma done |
a32c45a
to
fb4348c
Compare
In addition, it adds enumerations to access indexed arrays.
In addition, it adds enumerations to access indexed arrays.
fb4348c
to
3e0af8c
Compare
Thanks, yeah I noticed that you were right. I have not time to test this right now, I hope to have more time soon. |
What a huge PR, how can this be reviewed? |
Just compile the code with Address Sanitizer enabled. Next, run mate-power-statistics and mate-power-preferences from the command line.
g_settings_get_string returns a new allocated memory, not a beforestatic const gchar *history_type;
static const gchar *stats_type; history_type = g_settings_get_string (settings, GPM_SETTINGS_INFO_HISTORY_TYPE); stats_type = g_settings_get_string (settings, GPM_SETTINGS_INFO_STATS_TYPE); |
It seems that those leaks are fixed in my test.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
runs fine, but needs to be reviewed by another reviewer because it is a huge code change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While mate-power-statistics doesn't return any data on my desktop, the empty graph does come up and nothing crashes. The preference dialog behaves the same as in master.I can turn the display of the m-p-m status icon on and off same as before. Note that problems when fixing memory leaks often lead to segfaults and I didn't get any crashes.
Testing this on the converted Chromebook, mate-power-statistics works fine, as do options in the "on battery power" tab in the preferences dialog. Will merge |
No description provided.