{
#ifdef DEBUG_REF_COUNTS
accessible_count++;
+ g_hash_table_insert (_atspi_get_live_refs (), accessible, NULL);
g_print("at-spi: init: %d objects\n", accessible_count);
#endif
}
#ifdef DEBUG_REF_COUNTS
accessible_count--;
+ g_hash_table_remove (_atspi_get_live_refs (), accessible);
g_print ("at-spi: finalize: %d objects\n", accessible_count);
#endif
return -1;
}
-static GHashTable *
-get_live_refs (void)
+GHashTable *
+_atspi_get_live_refs (void)
{
if (!live_refs)
{
handle_add_accessible (DBusConnection *bus, DBusMessage *message, void *user_data)
{
DBusMessageIter iter;
- const char *sender = dbus_message_get_sender (message);
if (strcmp (dbus_message_get_signature (message), cache_signal_type) != 0)
{
if (in_process_deferred_messages)
return TRUE;
in_process_deferred_messages = 1;
- while (closure = g_queue_pop_head (deferred_messages))
+ while ((closure = g_queue_pop_head (deferred_messages)))
{
process_deferred_message (closure);
dbus_message_unref (closure->message);
g_type_init ();
- get_live_refs();
+ _atspi_get_live_refs();
bus = atspi_get_a11y_bus ();
if (!bus)
static void
remove_hung_process (DBusPendingCall *pending, void *data)
{
- gchar *bus_name = data;
hung_processes = g_slist_remove (hung_processes, data);
g_free (data);
&nitems, &leftover, &data_x11);
XCloseDisplay (bridge_display);
- data = g_strdup (data_x11);
+ data = g_strdup ((gchar *)data_x11);
XFree (data_x11);
return data;
}
DBusConnection *
atspi_get_a11y_bus (void)
{
- DBusConnection *bus = NULL;
DBusError error;
char *address;
method_call_timeout = val;
app_startup_time = startup_time;
}
+
+#ifdef DEBUG_REF_COUNTS
+static void
+print_disposed (gpointer key, gpointer value, gpointer data)
+{
+ AtspiAccessible *accessible = key;
+ if (accessible->parent.app)
+ return;
+ g_print ("disposed: %s %d\n", accessible->name, accessible->role);
+}
+
+void
+debug_disposed ()
+{
+ g_hash_table_foreach (live_refs, print_disposed, NULL);
+}
+#endif
notify_keystroke_listener (DeviceListenerEntry *e)
{
gchar *path = _atspi_device_listener_get_path (e->listener);
- gint i;
dbus_uint32_t d_modmask = e->modmask;
dbus_uint32_t d_event_types = e->event_types;
AtspiEventListenerMode listener_mode;
atspi_path_dec, atspi_interface_dec,
"RegisterKeystrokeListener", &d_error,
"oa(iisi)uu(bbb)=>b", path, e->key_set,
- e->modmask, e->event_types, &listener_mode,
+ d_modmask, d_event_types, &listener_mode,
&retval);
if (dbus_error_is_set (&d_error))
{