From: Seunghun Lee Date: Wed, 6 Jul 2022 07:31:04 +0000 (+0900) Subject: input: Fix segfault caused by the access null X-Git-Tag: submit/tizen/20220818.083245~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F279090%2F1;p=platform%2Fcore%2Fuifw%2Fheadless-server.git input: Fix segfault caused by the access null Change-Id: I5b45ab184dbd216de35ad032c03b469aab2116d8 --- diff --git a/src/input/input.c b/src/input/input.c index 8469d13..dbe1bb3 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -171,14 +171,17 @@ handle_top_change(struct wl_listener *listener, void *data) input = wl_container_of(listener, input, top_change); - input->top_view = view; - - if (input->top_view_destroy.notify) + if (input->top_view_destroy.notify) { wl_list_remove(&input->top_view_destroy.link); - else + input->top_view_destroy.notify = NULL; + } + + if (view) { input->top_view_destroy.notify = handle_top_view_destroy; + wl_signal_add(&view->events.destroy, &input->top_view_destroy); + } - wl_signal_add(&view->events.destroy, &input->top_view_destroy); + input->top_view = view; } static void