Mir

Merge lp:~cemil-azizoglu/mir/fix-1661704 into lp:mir

Proposed by Cemil Azizoglu on 2017-02-03
Status: Merged
Approved by: Daniel van Vugt on 2017-02-06
Approved revision: 4013
Merged at revision: 4013
Proposed branch: lp:~cemil-azizoglu/mir/fix-1661704
Merge into: lp:mir
Diff against target: 81 lines (+32/-4)
3 files modified
include/client/mir_toolkit/mir_window.h (+1/-1)
src/client/mir_surface_api.cpp (+6/-3)
tests/acceptance-tests/test_client_library.cpp (+25/-0)
To merge this branch: bzr merge lp:~cemil-azizoglu/mir/fix-1661704
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve on 2017-02-06
Daniel van Vugt 2017-02-03 Approve on 2017-02-06
Review via email: mp+316363@code.launchpad.net

Commit message

Check returned wh against null before calling its method.

Description of the change

Check returned wh against null before calling its method.

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4011
https://mir-jenkins.ubuntu.com/job/mir-ci/2936/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/3886/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3965
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3955
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3955
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3955
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3913/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3913/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3913/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3913
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3913/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3913
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3913/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3913/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2936/rebuild

review: Needs Fixing (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4012
https://mir-jenkins.ubuntu.com/job/mir-ci/2939/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/3890/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3969
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3959
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3959
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3959
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3917/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3917
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3917/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3917
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3917/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3917
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3917/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3917
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3917/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3917
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3917/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2939/rebuild

review: Needs Fixing (continuous-integration)
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4013
https://mir-jenkins.ubuntu.com/job/mir-ci/2941/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/3893
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3972
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3961
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3961
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3961
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3919
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3919/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3919
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3919/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3919
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3919/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3919
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3919/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3919
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3919/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3919
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3919/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2941/rebuild

review: Approve (continuous-integration)
Daniel van Vugt (vanvugt) wrote :

Ah yes, NULL wait handles. The old mir_wait* functions we just deprecated would have solved this :)

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/1072/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/3894/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/1130/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3973
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3963
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3963
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3963
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3921
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3921/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3921
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3921/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3921
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3921/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3921
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3921/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3921
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3921/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3921/console

review: Needs Fixing (continuous-integration)
Daniel van Vugt (vanvugt) wrote :
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/client/mir_toolkit/mir_window.h'
2--- include/client/mir_toolkit/mir_window.h 2017-02-02 19:17:46 +0000
3+++ include/client/mir_toolkit/mir_window.h 2017-02-03 22:38:23 +0000
4@@ -784,7 +784,7 @@
5 * be freed with a call to mir_persistent_id_release()
6 */
7 MirPersistentId* mir_window_request_persistent_id_sync(MirWindow* window)
8-__attribute__((deprecated("Use mir_window_request_persistent_id_sync")));
9+__attribute__((deprecated("Use mir_window_request_window_id_sync")));
10 MirWindowId* mir_window_request_window_id_sync(MirWindow* window);
11 #ifdef __cplusplus
12 }
13
14=== modified file 'src/client/mir_surface_api.cpp'
15--- src/client/mir_surface_api.cpp 2017-02-02 19:17:46 +0000
16+++ src/client/mir_surface_api.cpp 2017-02-03 22:38:23 +0000
17@@ -825,7 +825,8 @@
18 mir::require(mir_window_is_valid(window));
19
20 MirWindowId* result = nullptr;
21- mir_window_request_persistent_id_helper(window, &assign_surface_id_result, &result)->wait_for_all();
22+ if (auto wh = mir_window_request_persistent_id_helper(window, &assign_surface_id_result, &result))
23+ wh->wait_for_all();
24 return result;
25 }
26
27@@ -1262,7 +1263,8 @@
28 MirWindowId* mir_surface_request_persistent_id_sync(MirSurface *surface)
29 {
30 MirWindowId* result = nullptr;
31- mir_window_request_persistent_id_helper(surface, &assign_surface_id_result, &result)->wait_for_all();
32+ if (auto wh = mir_window_request_persistent_id_helper(surface, &assign_surface_id_result, &result))
33+ wh->wait_for_all();
34 return result;
35 }
36
37@@ -1318,6 +1320,7 @@
38 mir::require(mir_window_is_valid(window));
39
40 MirWindowId* result = nullptr;
41- mir_window_request_persistent_id_helper(window, &assign_surface_id_result, &result)->wait_for_all();
42+ if (auto wh = mir_window_request_persistent_id_helper(window, &assign_surface_id_result, &result))
43+ wh->wait_for_all();
44 return result;
45 }
46
47=== modified file 'tests/acceptance-tests/test_client_library.cpp'
48--- tests/acceptance-tests/test_client_library.cpp 2017-02-01 19:54:40 +0000
49+++ tests/acceptance-tests/test_client_library.cpp 2017-02-03 22:38:23 +0000
50@@ -1185,6 +1185,31 @@
51 }
52 #pragma GCC diagnostic pop
53
54+//lp:1661704
55+TEST_F(ClientLibrary, can_get_window_id_more_than_once_in_quick_succession)
56+{
57+ auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
58+
59+ auto surface_spec = mir_create_normal_window_spec(connection, 800, 600);
60+ mir_window_spec_set_pixel_format(surface_spec, mir_pixel_format_argb_8888);
61+ auto window = mir_create_window_sync(surface_spec);
62+ mir_window_spec_release(surface_spec);
63+
64+ ASSERT_THAT(window, IsValid());
65+
66+ MirWindowId* surface_id;
67+ MirWindowId* window_id = nullptr; //circumvent ‘window_id’ uninitialized error
68+ surface_id = mir_window_request_window_id_sync(window);
69+ EXPECT_NO_THROW({
70+ window_id = mir_window_request_window_id_sync(window);
71+ });
72+
73+ mir_window_id_release(surface_id);
74+ mir_window_id_release(window_id);
75+ mir_window_release_sync(window);
76+ mir_connection_release(connection);
77+}
78+
79 TEST_F(ClientLibrary, creates_buffer_streams)
80 {
81 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);

Subscribers

People subscribed via source and target branches