[at-spi2-atk] Added a new boolean parameter to allow specifying when a call to g_object_unref should be done by th
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-atk] Added a new boolean parameter to allow specifying when a call to g_object_unref should be done by th
- Date: Tue, 22 Jun 2010 07:52:07 +0000 (UTC)
commit 73469041fcbb7b5e81d4ca3877f6614795a69e50
Author: Mario Sanchez Prada <msanchez igalia com>
Date: Tue Jun 22 03:50:37 2010 -0400
Added a new boolean parameter to allow specifying when a call to
g_object_unref should be done by the end of that function, since there
are many functions in the ATK API that do not return an extra
reference, and therefore do not need this extra unref.
Updated all callers accordingly.
Bug #622309
atk-adaptor/adaptors/accessible-adaptor.c | 4 ++--
atk-adaptor/adaptors/cache-adaptor.c | 3 ++-
atk-adaptor/adaptors/component-adaptor.c | 2 +-
atk-adaptor/adaptors/hyperlink-adaptor.c | 2 +-
atk-adaptor/adaptors/selection-adaptor.c | 2 +-
atk-adaptor/adaptors/table-adaptor.c | 6 +++---
atk-adaptor/object.c | 4 ++--
atk-adaptor/object.h | 2 +-
8 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/atk-adaptor/adaptors/accessible-adaptor.c b/atk-adaptor/adaptors/accessible-adaptor.c
index 9872c41..1983807 100644
--- a/atk-adaptor/adaptors/accessible-adaptor.c
+++ b/atk-adaptor/adaptors/accessible-adaptor.c
@@ -194,7 +194,7 @@ impl_GetChildAtIndex (DBusConnection * bus,
g_free (child_name);
}
child = atk_object_ref_accessible_child (object, i);
- return spi_object_return_reference (message, child);
+ return spi_object_return_reference (message, child, TRUE);
}
static DBusMessage *
@@ -496,7 +496,7 @@ impl_GetApplication (DBusConnection * bus,
DBusMessage * message, void *user_data)
{
AtkObject *root = g_object_ref (atk_get_root ());
- return spi_object_return_reference (message, root);
+ return spi_object_return_reference (message, root, TRUE);
}
static DBusMessage *
diff --git a/atk-adaptor/adaptors/cache-adaptor.c b/atk-adaptor/adaptors/cache-adaptor.c
index 4bdb7cb..7eb69e4 100644
--- a/atk-adaptor/adaptors/cache-adaptor.c
+++ b/atk-adaptor/adaptors/cache-adaptor.c
@@ -280,7 +280,8 @@ static DBusMessage *
impl_GetRoot (DBusConnection * bus, DBusMessage * message, void *user_data)
{
return spi_object_return_reference (message,
- g_object_ref (G_OBJECT (spi_global_app_data->root)));
+ g_object_ref (G_OBJECT (spi_global_app_data->root)),
+ TRUE);
}
/*---------------------------------------------------------------------------*/
diff --git a/atk-adaptor/adaptors/component-adaptor.c b/atk-adaptor/adaptors/component-adaptor.c
index 2b86e94..5726c6f 100644
--- a/atk-adaptor/adaptors/component-adaptor.c
+++ b/atk-adaptor/adaptors/component-adaptor.c
@@ -83,7 +83,7 @@ impl_GetAccessibleAtPoint (DBusConnection * bus, DBusMessage * message,
child =
atk_component_ref_accessible_at_point (component, x, y,
(AtkCoordType) coord_type);
- return spi_object_return_reference (message, child);
+ return spi_object_return_reference (message, child, TRUE);
}
static DBusMessage *
diff --git a/atk-adaptor/adaptors/hyperlink-adaptor.c b/atk-adaptor/adaptors/hyperlink-adaptor.c
index cd0a924..124d01c 100644
--- a/atk-adaptor/adaptors/hyperlink-adaptor.c
+++ b/atk-adaptor/adaptors/hyperlink-adaptor.c
@@ -81,7 +81,7 @@ impl_GetObject (DBusConnection * bus, DBusMessage * message, void *user_data)
return droute_invalid_arguments_error (message);
}
atk_object = atk_hyperlink_get_object (link, i);
- return spi_object_return_reference (message, atk_object);
+ return spi_object_return_reference (message, atk_object, FALSE);
}
static DBusMessage *
diff --git a/atk-adaptor/adaptors/selection-adaptor.c b/atk-adaptor/adaptors/selection-adaptor.c
index 35bc49a..0f6b722 100644
--- a/atk-adaptor/adaptors/selection-adaptor.c
+++ b/atk-adaptor/adaptors/selection-adaptor.c
@@ -67,7 +67,7 @@ impl_GetSelectedChild (DBusConnection * bus, DBusMessage * message,
return droute_invalid_arguments_error (message);
}
atk_object = atk_selection_ref_selection (selection, selectedChildIndex);
- return spi_object_return_reference (message, atk_object);
+ return spi_object_return_reference (message, atk_object, TRUE);
}
static DBusMessage *
diff --git a/atk-adaptor/adaptors/table-adaptor.c b/atk-adaptor/adaptors/table-adaptor.c
index 6b00293..d54ebce 100644
--- a/atk-adaptor/adaptors/table-adaptor.c
+++ b/atk-adaptor/adaptors/table-adaptor.c
@@ -108,7 +108,7 @@ impl_GetAccessibleAt (DBusConnection * bus, DBusMessage * message,
return droute_invalid_arguments_error (message);
}
obj = atk_table_ref_at (table, row, column);
- return spi_object_return_reference (message, obj);
+ return spi_object_return_reference (message, obj, TRUE);
}
static DBusMessage *
@@ -331,7 +331,7 @@ impl_GetRowHeader (DBusConnection * bus, DBusMessage * message,
return droute_invalid_arguments_error (message);
}
obj = atk_table_get_row_header (table, row);
- return spi_object_return_reference (message, obj);
+ return spi_object_return_reference (message, obj, FALSE);
}
static DBusMessage *
@@ -352,7 +352,7 @@ impl_GetColumnHeader (DBusConnection * bus, DBusMessage * message,
return droute_invalid_arguments_error (message);
}
obj = atk_table_get_column_header (table, column);
- return spi_object_return_reference (message, obj);
+ return spi_object_return_reference (message, obj, FALSE);
}
static DBusMessage *
diff --git a/atk-adaptor/object.c b/atk-adaptor/object.c
index 04e456f..7ad7f92 100644
--- a/atk-adaptor/object.c
+++ b/atk-adaptor/object.c
@@ -175,7 +175,7 @@ spi_object_append_desktop_reference (DBusMessageIter * iter)
}
DBusMessage *
-spi_object_return_reference (DBusMessage * msg, AtkObject * obj)
+spi_object_return_reference (DBusMessage * msg, AtkObject * obj, gboolean unref)
{
DBusMessage *reply;
@@ -186,7 +186,7 @@ spi_object_return_reference (DBusMessage * msg, AtkObject * obj)
dbus_message_iter_init_append (reply, &iter);
spi_object_append_reference (&iter, obj);
}
- if (obj)
+ if (unref && obj)
g_object_unref (G_OBJECT (obj));
return reply;
diff --git a/atk-adaptor/object.h b/atk-adaptor/object.h
index 3b27292..eb38564 100644
--- a/atk-adaptor/object.h
+++ b/atk-adaptor/object.h
@@ -46,7 +46,7 @@ void
spi_object_append_null_reference (DBusMessageIter * iter);
DBusMessage *
-spi_object_return_reference (DBusMessage * msg, AtkObject * obj);
+spi_object_return_reference (DBusMessage * msg, AtkObject * obj, gboolean unref);
DBusMessage *
spi_hyperlink_return_reference (DBusMessage * msg, AtkHyperlink * obj);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]