Merge lp:~thomir-deactivatedaccount/unity/fix-sc-integration into lp:unity

Proposed by Thomi Richards
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 2179
Proposed branch: lp:~thomir-deactivatedaccount/unity/fix-sc-integration
Merge into: lp:unity
Diff against target: 29 lines (+3/-3)
1 file modified
plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp (+3/-3)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/unity/fix-sc-integration
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+99657@code.launchpad.net

Commit message

Fix a crash in the launcher software center integration code.

Description of the change

Took Gord's branch, added variable initialisatin (as requested on the original MP), and re-proposed.

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Looks good.

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

Letting this through without a test. There are autopilot tests for this coming with the next branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp'
2--- plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp 2012-03-21 12:31:11 +0000
3+++ plugins/unityshell/src/SoftwareCenterLauncherIcon.cpp 2012-03-28 20:32:20 +0000
4@@ -53,12 +53,12 @@
5 {
6 gint32 progress;
7 glib::String property_name;
8- GVariant* property_value;
9
10- g_variant_get_child(params, 0, "s", property_name.AsOutParam());
11+ g_variant_get_child(params, 0, "s", &property_name);
12
13 if (property_name.Str() == "Progress")
14 {
15+ GVariant* property_value = nullptr;
16 g_variant_get_child(params, 1, "v", &property_value);
17 g_variant_get(property_value, "i", &progress);
18
19@@ -66,9 +66,9 @@
20 SetQuirk(QUIRK_PROGRESS, true);
21
22 SetProgress(progress/100.0f);
23+ g_variant_unref(property_value);
24 }
25
26- g_variant_unref(property_value);
27 }
28
29 }