Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-perf-monitor-dangling-window-pointer-fix into lp:ubuntu-ui-toolkit/staging

Proposed by Loïc Molinari on 2016-02-18
Status: Merged
Approved by: Zsombor Egri on 2016-02-18
Approved revision: 1858
Merged at revision: 1858
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-perf-monitor-dangling-window-pointer-fix
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 50 lines (+10/-1)
2 files modified
src/Ubuntu/Components/plugin/ucperformancemonitor.cpp (+9/-1)
src/Ubuntu/Components/plugin/ucperformancemonitor.h (+1/-0)
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-perf-monitor-dangling-window-pointer-fix
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve on 2016-02-18
Zsombor Egri 2016-02-18 Approve on 2016-02-18
Review via email: mp+286488@code.launchpad.net

Commit message

Fixed performance monitor dangling pointer crash.

Description of the change

Fixed performance monitor dangling pointer crash.

To post a comment you must log in.
Zsombor Egri (zsombi) wrote :

Thanks, Loic, for saving us!!!!!!!!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/plugin/ucperformancemonitor.cpp'
2--- src/Ubuntu/Components/plugin/ucperformancemonitor.cpp 2016-01-29 07:43:58 +0000
3+++ src/Ubuntu/Components/plugin/ucperformancemonitor.cpp 2016-02-18 11:38:42 +0000
4@@ -39,7 +39,6 @@
5
6 UCPerformanceMonitor::~UCPerformanceMonitor()
7 {
8- connectToWindow(NULL);
9 }
10
11 QQuickWindow* UCPerformanceMonitor::findQQuickWindow()
12@@ -75,6 +74,8 @@
13 this, &UCPerformanceMonitor::startTimer);
14 QObject::disconnect(m_window, &QQuickWindow::afterRendering,
15 this, &UCPerformanceMonitor::stopTimer);
16+ QObject::disconnect(m_window, &QWindow::destroyed,
17+ this, &UCPerformanceMonitor::windowDestroyed);
18 }
19
20 m_window = window;
21@@ -86,6 +87,8 @@
22 QObject::connect(m_window, &QQuickWindow::afterRendering,
23 this, &UCPerformanceMonitor::stopTimer,
24 Qt::DirectConnection);
25+ QObject::connect(m_window, &QWindow::destroyed,
26+ this, &UCPerformanceMonitor::windowDestroyed);
27 }
28 }
29 }
30@@ -126,3 +129,8 @@
31 connectToWindow(NULL);
32 }
33 }
34+
35+void UCPerformanceMonitor::windowDestroyed()
36+{
37+ connectToWindow(NULL);
38+}
39
40=== modified file 'src/Ubuntu/Components/plugin/ucperformancemonitor.h'
41--- src/Ubuntu/Components/plugin/ucperformancemonitor.h 2016-01-19 13:01:44 +0000
42+++ src/Ubuntu/Components/plugin/ucperformancemonitor.h 2016-02-18 11:38:42 +0000
43@@ -38,6 +38,7 @@
44 void connectToWindow(QQuickWindow* window);
45 void startTimer();
46 void stopTimer();
47+ void windowDestroyed();
48
49 private:
50 QQuickWindow* findQQuickWindow();

Subscribers

People subscribed via source and target branches