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
=== modified file 'launcher/LauncherController.cpp'
--- launcher/LauncherController.cpp 2012-09-20 00:08:23 +0000
+++ launcher/LauncherController.cpp 2012-10-17 17:19:20 +0000
@@ -113,6 +113,8 @@
113 , launcher_key_press_time_(0)113 , launcher_key_press_time_(0)
114 , dbus_owner_(g_bus_own_name(G_BUS_TYPE_SESSION, DBUS_NAME.c_str(), G_BUS_NAME_OWNER_FLAGS_NONE,114 , dbus_owner_(g_bus_own_name(G_BUS_TYPE_SESSION, DBUS_NAME.c_str(), G_BUS_NAME_OWNER_FLAGS_NONE,
115 OnBusAcquired, nullptr, nullptr, this, nullptr))115 OnBusAcquired, nullptr, nullptr, this, nullptr))
116 , gdbus_connection_(nullptr)
117 , reg_id_(0)
116{118{
117 edge_barriers_.options = parent_->options();119 edge_barriers_.options = parent_->options();
118120
@@ -165,6 +167,9 @@
165 launcher_ptr->GetParent()->UnReference();167 launcher_ptr->GetParent()->UnReference();
166 }168 }
167169
170 if (gdbus_connection_ && reg_id_)
171 g_dbus_connection_unregister_object(gdbus_connection_, reg_id_);
172
168 g_bus_unown_name(dbus_owner_);173 g_bus_unown_name(dbus_owner_);
169}174}
170175
@@ -1402,7 +1407,6 @@
1402void Controller::Impl::OnBusAcquired(GDBusConnection* connection, const gchar* name, gpointer user_data)1407void Controller::Impl::OnBusAcquired(GDBusConnection* connection, const gchar* name, gpointer user_data)
1403{1408{
1404 GDBusNodeInfo* introspection_data = g_dbus_node_info_new_for_xml(DBUS_INTROSPECTION.c_str(), nullptr);1409 GDBusNodeInfo* introspection_data = g_dbus_node_info_new_for_xml(DBUS_INTROSPECTION.c_str(), nullptr);
1405 unsigned int reg_id;
14061410
1407 if (!introspection_data)1411 if (!introspection_data)
1408 {1412 {
@@ -1410,11 +1414,14 @@
1410 return;1414 return;
1411 }1415 }
14121416
1413 reg_id = g_dbus_connection_register_object(connection, DBUS_PATH.c_str(),1417 auto self = static_cast<Controller::Impl*>(user_data);
1414 introspection_data->interfaces[0],1418
1415 &interface_vtable, user_data,1419 self->gdbus_connection_ = connection;
1416 nullptr, nullptr);1420 self->reg_id_ = g_dbus_connection_register_object(connection, DBUS_PATH.c_str(),
1417 if (!reg_id)1421 introspection_data->interfaces[0],
1422 &interface_vtable, user_data,
1423 nullptr, nullptr);
1424 if (!self->reg_id_)
1418 {1425 {
1419 LOG_WARNING(logger) << "Object registration failed. Won't get dynamic launcher addition.";1426 LOG_WARNING(logger) << "Object registration failed. Won't get dynamic launcher addition.";
1420 }1427 }
14211428
=== modified file 'launcher/LauncherControllerPrivate.h'
--- launcher/LauncherControllerPrivate.h 2012-09-17 14:57:22 +0000
+++ launcher/LauncherControllerPrivate.h 2012-10-17 17:19:20 +0000
@@ -135,8 +135,10 @@
135 int reactivate_index;135 int reactivate_index;
136 bool keynav_restore_window_;136 bool keynav_restore_window_;
137 int launcher_key_press_time_;137 int launcher_key_press_time_;
138
138 unsigned dbus_owner_;139 unsigned dbus_owner_;
139140 GDBusConnection* gdbus_connection_;
141 unsigned reg_id_;
140142
141 glib::Signal<void, BamfMatcher*, BamfView*> view_opened_signal_;143 glib::Signal<void, BamfMatcher*, BamfView*> view_opened_signal_;
142 glib::SourceManager sources_;144 glib::SourceManager sources_;

Subscribers

People subscribed via source and target branches