Merge lp:~azzar1/unity/fix-some-memory-leaks2 into lp:unity

Proposed by Andrea Azzarone on 2011-07-30
Status: Merged
Approved by: Neil J. Patel on 2011-08-01
Approved revision: 1325
Merged at revision: 1329
Proposed branch: lp:~azzar1/unity/fix-some-memory-leaks2
Merge into: lp:unity
Diff against target: 30 lines (+6/-2)
2 files modified
plugins/unityshell/src/PlacesHomeView.cpp (+3/-2)
plugins/unityshell/src/PluginAdapter.cpp (+3/-0)
To merge this branch: bzr merge lp:~azzar1/unity/fix-some-memory-leaks2
Reviewer Review Type Date Requested Status
Neil J. Patel (community) 2011-07-30 Approve on 2011-08-01
Review via email: mp+69885@code.launchpad.net

Description of the change

Fixes two memory leaks in unity.

To post a comment you must log in.
Neil J. Patel (njpatel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/PlacesHomeView.cpp'
2--- plugins/unityshell/src/PlacesHomeView.cpp 2011-07-21 14:59:25 +0000
3+++ plugins/unityshell/src/PlacesHomeView.cpp 2011-07-30 12:46:00 +0000
4@@ -297,9 +297,10 @@
5 // Email
6 markup = gconf_client_get_string(_client, MAIL_DIR"/command", NULL);
7 // get the first word on key (the executable name itself)
8- markup = g_strsplit(markup, " ", 0)[0];
9- CreateShortcutFromExec(markup, _("Check Email"), _email_alternatives);
10+ gchar** temp_array = g_strsplit(markup, " ", 0);
11 g_free(markup);
12+ CreateShortcutFromExec(temp_array[0], _("Check Email"), _email_alternatives);
13+ g_strfreev(temp_array);
14
15 // Music
16 markup = gconf_client_get_string(_client, MEDIA_DIR"/exec", NULL);
17
18=== modified file 'plugins/unityshell/src/PluginAdapter.cpp'
19--- plugins/unityshell/src/PluginAdapter.cpp 2011-07-26 12:33:23 +0000
20+++ plugins/unityshell/src/PluginAdapter.cpp 2011-07-30 12:46:00 +0000
21@@ -612,6 +612,9 @@
22 {
23 win_wmclass = classHint.res_class;
24 XFree(classHint.res_class);
25+
26+ if (classHint.res_name)
27+ XFree(classHint.res_name);
28 }
29 else
30 return;