summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>2022-11-30 16:15:45 +0700
committerTran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>2022-12-01 10:19:31 +0700
commita9384d1762a185d3d2b5b519273cd20eb0a79751 (patch)
treedcd71d7c451bc55df3b57769a35b06fcc1914743
parentf6911a11dc911a5bcb380d0895db6cfd533a3569 (diff)
downloadwayland-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.c20
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);