[java-atk-wrapper: 1/2] Gracefully abort initialization if at-spi fails



commit e81bfe97cdb422ca9646be303fc39d4aa578f3ca
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Mon Apr 1 23:21:25 2019 +0200

    Gracefully abort initialization if at-spi fails
    
    e.g. when at-spi bus information is bogus
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=770575

 jni/src/AtkWrapper.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index 1322d45..203d91b 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -58,7 +58,8 @@ static gboolean jaw_initialized = FALSE;
 
 gboolean jaw_accessibility_init (void)
 {
-  atk_bridge_adaptor_init (NULL, NULL);
+  if (atk_bridge_adaptor_init (NULL, NULL) < 0)
+    return FALSE;
   if (jaw_debug)
     printf("Atk Bridge Initialized\n");
   return TRUE;
@@ -123,6 +124,8 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_loadAtkBridge()
   jaw_initialized = jaw_accessibility_init();
   if (jaw_debug)
     printf("Jaw Initialization STATUS in loadAtkBridge: %d\n", jaw_initialized);
+  if (!jaw_initialized)
+    return;
 
   jni_main_loop = g_main_loop_new (NULL, FALSE); /*main loop NOT running*/
   thread = g_thread_new(message, jni_loop_callback, (void *) jni_main_loop);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]