Change log level to prevent abort.
[platform/upstream/at-spi2-core.git] / atspi / atspi-misc.c
index f60d834..6d69d21 100644 (file)
@@ -38,7 +38,7 @@
 #include <ctype.h>
 
 /* This value is not fixed, could be changed. */
-#define HASH_TABLE_SIZE_MAX 1000
+#define HASH_TABLE_SIZE_MAX 3000
 
 static void handle_get_items (DBusPendingCall *pending, void *user_data);
 
@@ -128,7 +128,10 @@ _atspi_bus ()
   if (!bus)
     atspi_init ();
   if (!bus)
-    g_error ("AT-SPI: Couldn't connect to accessibility bus. Is at-spi-bus-launcher running?");
+    {
+      g_warning ("AT-SPI: Couldn't connect to accessibility bus. Is at-spi-bus-launcher running?");
+      exit(0);
+    }
   return bus;
 }
 
@@ -906,43 +909,6 @@ atspi_dbus_filter (DBusConnection *bus, DBusMessage *message, void *data)
   return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
-/*
- * Returns a 'canonicalized' value for DISPLAY,
- * with the screen number stripped off if present.
- *
- * TODO: Avoid having duplicate functions for this here and in at-spi2-atk
- */
-static gchar *
-spi_display_name (void)
-{
-  char *canonical_display_name = NULL;
-  const gchar *display_env = g_getenv ("AT_SPI_DISPLAY");
-
-  if (!display_env)
-    {
-      display_env = g_getenv ("DISPLAY");
-      if (!display_env || !display_env[0])
-        return NULL;
-      else
-        {
-          gchar *display_p, *screen_p;
-          canonical_display_name = g_strdup (display_env);
-          display_p = g_utf8_strrchr (canonical_display_name, -1, ':');
-          screen_p = g_utf8_strrchr (canonical_display_name, -1, '.');
-          if (screen_p && display_p && (screen_p > display_p))
-            {
-              *screen_p = '\0';
-            }
-        }
-    }
-  else
-    {
-      canonical_display_name = g_strdup (display_env);
-    }
-
-  return canonical_display_name;
-}
-
 /**
  * atspi_init:
  *
@@ -1336,7 +1302,6 @@ _atspi_dbus_get_property (gpointer obj, const char *interface, const char *name,
   }
   if (!strcmp (type, "(so)"))
   {
-    g_object_unref(*(AtspiAccessible**)data);
     *((AtspiAccessible **)data) = _atspi_dbus_return_accessible_from_iter (&iter_variant);
   }
   else
@@ -1536,6 +1501,43 @@ _atspi_error_quark (void)
  * Gets the IOR from the XDisplay.
  */
 #ifdef HAVE_X11
+/*
+ * Returns a 'canonicalized' value for DISPLAY,
+ * with the screen number stripped off if present.
+ *
+ * TODO: Avoid having duplicate functions for this here and in at-spi2-atk
+ */
+static gchar *
+spi_display_name (void)
+{
+  char *canonical_display_name = NULL;
+  const gchar *display_env = g_getenv ("AT_SPI_DISPLAY");
+
+  if (!display_env)
+    {
+      display_env = g_getenv ("DISPLAY");
+      if (!display_env || !display_env[0])
+        return NULL;
+      else
+        {
+          gchar *display_p, *screen_p;
+          canonical_display_name = g_strdup (display_env);
+          display_p = g_utf8_strrchr (canonical_display_name, -1, ':');
+          screen_p = g_utf8_strrchr (canonical_display_name, -1, '.');
+          if (screen_p && display_p && (screen_p > display_p))
+            {
+              *screen_p = '\0';
+            }
+        }
+    }
+  else
+    {
+      canonical_display_name = g_strdup (display_env);
+    }
+
+  return canonical_display_name;
+}
+
 static char *
 get_accessibility_bus_address_x11 (void)
 {
@@ -1598,7 +1600,7 @@ get_accessibility_bus_address_dbus (void)
   dbus_error_init (&error);
   reply = dbus_connection_send_with_reply_and_block (session_bus,
                                                     message,
-                                                    -1,
+                                                    15000,
                                                     &error);
   dbus_message_unref (message);