Merge lp:~azzar1/unity/fix-1047760-6.0 into lp:unity/6.0

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2787
Proposed branch: lp:~azzar1/unity/fix-1047760-6.0
Merge into: lp:unity/6.0
Diff against target: 66 lines (+16/-7)
2 files modified
launcher/LauncherController.cpp (+13/-6)
launcher/LauncherControllerPrivate.h (+3/-1)
To merge this branch: bzr merge lp:~azzar1/unity/fix-1047760-6.0
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+130178@code.launchpad.net

Commit message

Unregister gdbus object in the dtor. Fix bug 1047760

Description of the change

See lp:~andyrock/unity/fix-1047760 too.

== Problem ==
compiz crashed with SIGSEGV in unity::launcher::LauncherModel::begin() from unity::launcher::LauncherModel::GetSublist() from unity::launcher::Controller::Impl::OnLauncherAddRequestSpecial()

== Fix ==
unregister gdbus object

== Test ==
not applicable

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherController.cpp'
2--- launcher/LauncherController.cpp 2012-09-20 00:08:23 +0000
3+++ launcher/LauncherController.cpp 2012-10-17 17:19:20 +0000
4@@ -113,6 +113,8 @@
5 , launcher_key_press_time_(0)
6 , dbus_owner_(g_bus_own_name(G_BUS_TYPE_SESSION, DBUS_NAME.c_str(), G_BUS_NAME_OWNER_FLAGS_NONE,
7 OnBusAcquired, nullptr, nullptr, this, nullptr))
8+ , gdbus_connection_(nullptr)
9+ , reg_id_(0)
10 {
11 edge_barriers_.options = parent_->options();
12
13@@ -165,6 +167,9 @@
14 launcher_ptr->GetParent()->UnReference();
15 }
16
17+ if (gdbus_connection_ && reg_id_)
18+ g_dbus_connection_unregister_object(gdbus_connection_, reg_id_);
19+
20 g_bus_unown_name(dbus_owner_);
21 }
22
23@@ -1402,7 +1407,6 @@
24 void Controller::Impl::OnBusAcquired(GDBusConnection* connection, const gchar* name, gpointer user_data)
25 {
26 GDBusNodeInfo* introspection_data = g_dbus_node_info_new_for_xml(DBUS_INTROSPECTION.c_str(), nullptr);
27- unsigned int reg_id;
28
29 if (!introspection_data)
30 {
31@@ -1410,11 +1414,14 @@
32 return;
33 }
34
35- reg_id = g_dbus_connection_register_object(connection, DBUS_PATH.c_str(),
36- introspection_data->interfaces[0],
37- &interface_vtable, user_data,
38- nullptr, nullptr);
39- if (!reg_id)
40+ auto self = static_cast<Controller::Impl*>(user_data);
41+
42+ self->gdbus_connection_ = connection;
43+ self->reg_id_ = g_dbus_connection_register_object(connection, DBUS_PATH.c_str(),
44+ introspection_data->interfaces[0],
45+ &interface_vtable, user_data,
46+ nullptr, nullptr);
47+ if (!self->reg_id_)
48 {
49 LOG_WARNING(logger) << "Object registration failed. Won't get dynamic launcher addition.";
50 }
51
52=== modified file 'launcher/LauncherControllerPrivate.h'
53--- launcher/LauncherControllerPrivate.h 2012-09-17 14:57:22 +0000
54+++ launcher/LauncherControllerPrivate.h 2012-10-17 17:19:20 +0000
55@@ -135,8 +135,10 @@
56 int reactivate_index;
57 bool keynav_restore_window_;
58 int launcher_key_press_time_;
59+
60 unsigned dbus_owner_;
61-
62+ GDBusConnection* gdbus_connection_;
63+ unsigned reg_id_;
64
65 glib::Signal<void, BamfMatcher*, BamfView*> view_opened_signal_;
66 glib::SourceManager sources_;

Subscribers

People subscribed via source and target branches