Merge lp:~kamstrup/unity/crash-on-dbus-fail into lp:unity

Proposed by Mikkel Kamstrup Erlandsen
Status: Merged
Approved by: Mirco Müller
Approved revision: no longer in the source branch.
Merged at revision: 551
Proposed branch: lp:~kamstrup/unity/crash-on-dbus-fail
Merge into: lp:unity
Diff against target: 79 lines (+29/-12)
1 file modified
unity-private/places/places-place-entry.vala (+29/-12)
To merge this branch: bzr merge lp:~kamstrup/unity/crash-on-dbus-fail
Reviewer Review Type Date Requested Status
Mirco Müller (community) Approve
Review via email: mp+36546@code.launchpad.net

Description of the change

Fixes crasher when place daemons fails to start on DBus activation (bug #634364 "unity crashed with SIGSEGV in unity_places_place_entry_remote_set_active()")

To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote :

Code looks fine. Fix works (tried with failing places-daemons). Like the comment about the kittens :) Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-private/places/places-place-entry.vala'
2--- unity-private/places/places-place-entry.vala 2010-08-23 22:28:41 +0000
3+++ unity-private/places/places-place-entry.vala 2010-09-24 13:11:00 +0000
4@@ -148,7 +148,11 @@
5 if (_active != value)
6 {
7 _active = value;
8- remote.set_active.begin (_active);
9+ if (remote != null)
10+ remote.set_active.begin (_active);
11+ else
12+ warning ("Unable to set PlaceEntry as active. " +
13+ "No contact remote PlaceEntry");
14 }
15 }
16 }
17@@ -409,38 +413,51 @@
18 * a ValueArray, but not the async stuff.
19 *
20 * So basically we need both right now and every new place kills a
21- * thousand kittens.
22+ * thousand kittens (per hour).
23 */
24 service = connection.get_object (dbus_name,
25 dbus_path,
26 "com.canonical.Unity.PlaceEntry");
27-
28+
29+ service.RendererInfoChanged.connect (on_renderer_info_changed);
30+ service.PlaceEntryInfoChanged.connect (on_place_entry_info_changed);
31+
32+ online = true;
33+
34 } catch (Error e) {
35 warning (@"Unable to connect to $dbus_path on $dbus_name: %s",
36 e.message);
37+ online = false;
38 return;
39- }
40-
41- service.RendererInfoChanged.connect (on_renderer_info_changed);
42- service.PlaceEntryInfoChanged.connect (on_place_entry_info_changed);
43-
44- online = true;
45+ }
46 }
47
48 public void set_search (string search, HashTable<string, string> hints)
49 {
50- remote.set_search.begin (search, hints);
51+ if (remote != null)
52+ remote.set_search.begin (search, hints);
53+ else
54+ warning ("Unable to set search '%s'. " +
55+ "No connection to remote PlaceEntry", search);
56 }
57
58 public void set_active_section (uint section_id)
59 {
60- remote.set_active_section.begin (section_id);
61+ if (remote != null)
62+ remote.set_active_section.begin (section_id);
63+ else
64+ warning ("Unable to set active section %u. " +
65+ "No connection to remote PlaceEntry", section_id);
66 }
67
68 public void set_global_search (string search,
69 HashTable<string, string> hints)
70 {
71- remote.set_global_search.begin (search, hints);
72+ if (remote != null)
73+ remote.set_global_search.begin (search, hints);
74+ else
75+ warning ("Unable to set global search '%s'. " +
76+ "No connection to remote PlaceEntry", search);
77 }
78
79 /*