Merge lp:~azzar1/unity/fix-1047420 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2682
Proposed branch: lp:~azzar1/unity/fix-1047420
Merge into: lp:unity
Diff against target: 29 lines (+4/-7)
1 file modified
dash/CoverflowResultView.cpp (+4/-7)
To merge this branch: bzr merge lp:~azzar1/unity/fix-1047420
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+123694@code.launchpad.net

Commit message

Fix crash in unity::dash::CoverflowResultView::Impl::Impl()

Description of the change

== Problem ==
compiz crashed with SIGSEGV in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string() from operator() from unity::dash::CoverflowResultView::Impl::Impl()

== Fix ==
Use glib::String to auto-handle corner case.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Nice, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/CoverflowResultView.cpp'
2--- dash/CoverflowResultView.cpp 2012-08-23 14:23:08 +0000
3+++ dash/CoverflowResultView.cpp 2012-09-11 08:55:23 +0000
4@@ -161,11 +161,12 @@
5
6 ubus_.RegisterInterest(UBUS_DASH_PREVIEW_NAVIGATION_REQUEST, [&] (GVariant* data) {
7 int nav_mode = 0;
8- gchar* uri = NULL;
9- gchar* proposed_unique_id = NULL;
10+ glib::String uri;
11+ glib::String proposed_unique_id;
12+
13 g_variant_get(data, "(iss)", &nav_mode, &uri, &proposed_unique_id);
14
15- if (std::string(proposed_unique_id) != parent_->unique_id())
16+ if (proposed_unique_id.Str() != parent_->unique_id())
17 return;
18
19 unsigned num_results = coverflow_->model()->Items().size();
20@@ -192,10 +193,6 @@
21 ubus_.SendMessage(UBUS_DASH_PREVIEW_INFO_PAYLOAD,
22 g_variant_new("(iii)", 0, left_results, right_results));
23 }
24-
25- g_free(uri);
26- g_free(proposed_unique_id);
27-
28 });
29 }
30