Merge lp:~gerboland/unity-mir/fix-shutdown-crash into lp:unity-mir

Proposed by Gerry Boland
Status: Merged
Approved by: Michał Sawicz
Approved revision: 149
Merged at revision: 149
Proposed branch: lp:~gerboland/unity-mir/fix-shutdown-crash
Merge into: lp:unity-mir
Diff against target: 36 lines (+7/-1)
2 files modified
src/modules/Unity/Application/inputarea.cpp (+6/-1)
src/modules/Unity/Application/inputarea.h (+1/-0)
To merge this branch: bzr merge lp:~gerboland/unity-mir/fix-shutdown-crash
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Approve
Review via email: mp+196677@code.launchpad.net

Commit message

InputArea: don't use lambda function as slot, can cause crash on shutdown

Using lambda function as slot can introduce crash as the slot's object deletion is not registered unlike with traditional signal/slot connections. As a result, on signal emission, the lambda can be called on a deleted object.

Description of the change

InputArea: don't use lambda function as slot, can cause crash on shutdown

Using lambda function as slot can introduce crash as the slot's object deletion is not registered unlike with traditional signal/slot connections. As a result, on signal emission, the lambda can be called on a deleted object.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Fixes!

review: Approve
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Gerry, can you add that to you MP:
diff -u unity-mir-0.1+14.04.20131119/debian/changelog unity-mir-0.1+14.04.20131119/debian/changelog
--- unity-mir-0.1+14.04.20131119/debian/changelog
+++ unity-mir-0.1+14.04.20131119/debian/changelog
@@ -1,3 +1,10 @@
+unity-mir (0.1+14.04.20131119-0ubuntu2) trusty; urgency=low
+
+ * Cherry-pick upstream patch to avoid Unity8 crashing on stop
+ (LP: #1253685)
+
+ -- Didier Roche <email address hidden> Tue, 26 Nov 2013 10:47:29 +0100
+
 unity-mir (0.1+14.04.20131119-0ubuntu1) trusty; urgency=low

   [ Gerry Boland ]

Thanks! :)

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/modules/Unity/Application/inputarea.cpp'
--- src/modules/Unity/Application/inputarea.cpp 2013-10-31 12:35:59 +0000
+++ src/modules/Unity/Application/inputarea.cpp 2013-11-26 09:22:16 +0000
@@ -87,7 +87,7 @@
87 if (surface) {87 if (surface) {
88 // If surface is destroyed, make sure this InputArea doesn't point to it any more88 // If surface is destroyed, make sure this InputArea doesn't point to it any more
89 // For now, the QML engine owns this object so the MirSurface cannot delete it89 // For now, the QML engine owns this object so the MirSurface cannot delete it
90 connect(surface, &MirSurface::destroyed, [this]() { doSetSurface(nullptr); });90 connect(surface, &MirSurface::destroyed, this, &InputArea::setNullSurface);
91 }91 }
9292
93 if (m_surface) {93 if (m_surface) {
@@ -105,6 +105,11 @@
105 Q_EMIT surfaceChanged();105 Q_EMIT surfaceChanged();
106}106}
107107
108void InputArea::setNullSurface()
109{
110 doSetSurface(nullptr);
111}
112
108void InputArea::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)113void InputArea::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
109{114{
110 DLOG("InputArea::geometryChanged (this=%p)", this);115 DLOG("InputArea::geometryChanged (this=%p)", this);
111116
=== modified file 'src/modules/Unity/Application/inputarea.h'
--- src/modules/Unity/Application/inputarea.h 2013-08-29 14:46:43 +0000
+++ src/modules/Unity/Application/inputarea.h 2013-11-26 09:22:16 +0000
@@ -54,6 +54,7 @@
54private Q_SLOTS:54private Q_SLOTS:
55 void onAscendantChanged();55 void onAscendantChanged();
56 void onAscendantGeometryChanged();56 void onAscendantGeometryChanged();
57 void setNullSurface();
5758
58private:59private:
59 void listenToAscendantsChanges();60 void listenToAscendantsChanges();

Subscribers

People subscribed via source and target branches