From 4c1621c3d7edf56fc6a719a32dcdb83286bb0dcd Mon Sep 17 00:00:00 2001 From: Tomasz Olszak Date: Wed, 10 Jun 2015 12:12:54 +0200 Subject: [PATCH] Fixed state of screen-reader wher screen-reader exits abnormally When screen-reader e.g. crashed, bus-launcher didn't check if the process is still running before it tried to terminated it. In result screen-reader's invalid PID was kept and new screen-reader couldn't be launched. Change-Id: I599c7e7962a16b031e913c1a957b2f33f225a6f3 Signed-off-by: Tomasz Olszak --- bus/at-spi-bus-launcher.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 08566d6..a84270b 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -601,6 +601,16 @@ _terminate_screen_reader(A11yBusLauncher *bl) if (bl->pid <= 0) return FALSE; + + int status = aul_app_get_status_bypid(bl->pid); + + if (status < 0) + { + LOGD("App with pid %d already terminated", bl->pid); + bl->pid = 0; + return TRUE; + } + LOGD("terminate process with pid %d", bl->pid); if (!aul_terminate_pid(bl->pid)) { -- 2.7.4