diff options
author | Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com> | 2022-11-30 16:15:45 +0700 |
---|---|---|
committer | Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com> | 2022-12-01 10:19:31 +0700 |
commit | a9384d1762a185d3d2b5b519273cd20eb0a79751 (patch) | |
tree | dcd71d7c451bc55df3b57769a35b06fcc1914743 | |
parent | f6911a11dc911a5bcb380d0895db6cfd533a3569 (diff) | |
download | wayland-ivi-extension-a9384d1762a185d3d2b5b519273cd20eb0a79751.tar.gz |
simple-weston-client: fix crash and hang when exiting
wlcontext->debug_iface didn't bind when weston has been running
with non debug option. So, we need to check it before call
weston_debug_v1_destroy.
Need to remove the while loop after send SIGINT, the stream->ojb
always available in this case, then it makes a hang here.
Signed-off-by: Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>
-rw-r--r-- | ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c b/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c index a0632c7..1434c31 100644 --- a/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c +++ b/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c @@ -887,24 +887,8 @@ int main (int argc, const char * argv[]) Error: #ifdef LIBWESTON_DEBUG_PROTOCOL - weston_debug_v1_destroy(wlcontext->debug_iface); - - while (1) { - struct debug_stream *stream; - int empty = 1; - - wl_list_for_each(stream, &wlcontext->stream_list, link) - if (stream->obj) { - empty = 0; - break; - } - - if (empty) - break; - - if (wl_display_dispatch(wlcontext->wl_display) < 0) - break; - } + if(wlcontext->debug_iface) + weston_debug_v1_destroy(wlcontext->debug_iface); destroy_streams(wlcontext); wl_display_roundtrip(wlcontext->wl_display); |