Merge lp:~nick-dedekind/unity8/UnityMenuModelStack-LeakFix into lp:unity8

Proposed by Nick Dedekind on 2015-10-08
Status: Merged
Approved by: Albert Astals Cid on 2015-10-09
Approved revision: 2001
Merged at revision: 2012
Proposed branch: lp:~nick-dedekind/unity8/UnityMenuModelStack-LeakFix
Merge into: lp:unity8
Diff against target: 32 lines (+2/-9)
1 file modified
tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp (+2/-9)
To merge this branch: bzr merge lp:~nick-dedekind/unity8/UnityMenuModelStack-LeakFix
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) 2015-10-08 Approve on 2015-10-09
PS Jenkins bot continuous-integration Needs Fixing on 2015-10-09
Review via email: mp+273858@code.launchpad.net

Commit Message

Fixed leak in UnityMenuModelStackTest

Description of the Change

Fixed leak in UnityMenuModelStackTest

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
2001. By Nick Dedekind on 2015-10-08

use sendEvents

PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2000
http://jenkins.qa.ubuntu.com/job/unity8-ci/6435/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4560
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/814
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1147
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/466
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1042
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1043
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/674
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/675
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3699
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4557
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4557/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24080
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/488
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/814
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/814/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24081

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6435/rebuild

review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2001
http://jenkins.qa.ubuntu.com/job/unity8-ci/6441/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4573
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/820
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1153
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/472
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1048
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1049
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/680
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/681
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3707
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4570
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4570/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24098
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/491
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/820
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/820/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24096

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6441/rebuild

review: Needs Fixing (continuous-integration)
Albert Astals Cid (aacid) :
review: Approve
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
Yes for what it can

 * Did you make sure that the branch does not contain spurious tags?
Yes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp'
2--- tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp 2015-08-19 13:56:21 +0000
3+++ tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp 2015-10-08 15:26:25 +0000
4@@ -43,6 +43,8 @@
5 {
6 delete m_model;
7 m_model = nullptr;
8+ // send deleteLaters to avoid leaks.
9+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
10 }
11
12 void testHeadOnSetHead()
13@@ -146,19 +148,10 @@
14
15 m_model->removeRow(removeIndex);
16
17- waitFor([&stack, resultCount]() { return stack.count() == resultCount; }, 1000);
18 QCOMPARE(stack.count(), resultCount);
19 }
20
21 private:
22- bool waitFor(std::function<bool()> functor, int ms) {
23-
24- QElapsedTimer timer;
25- timer.start();
26- while(!functor() && timer.elapsed() < ms) { QTest::qWait(10); }
27- return functor();
28- }
29-
30 QVariant recuseAddMenu(int subMenuCount, int depth_remaining)
31 {
32 QVariantList rows;

Subscribers

People subscribed via source and target branches