[at-spi2-atk] Don't iterate over the list twice when removing events
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-atk] Don't iterate over the list twice when removing events
- Date: Mon, 20 Aug 2012 19:28:38 +0000 (UTC)
commit 3cdd2ef552996044c51109415384ee043e2f2c57
Author: Mike Gorse <mgorse suse com>
Date: Mon Aug 20 14:29:22 2012 -0500
Don't iterate over the list twice when removing events
https://bugzilla.gnome.org/show_bug.cgi?id=679295
atk-adaptor/bridge.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
index 08dfbd4..96fdbf9 100644
--- a/atk-adaptor/bridge.c
+++ b/atk-adaptor/bridge.c
@@ -575,11 +575,20 @@ remove_events (const char *bus_name, const char *event)
spi_event_is_subtype (evdata->data, remove_data))
{
GList *events = spi_global_app_data->events;
- list = list->next;
g_strfreev (evdata->data);
g_free (evdata->bus_name);
g_free (evdata);
- spi_global_app_data->events = g_list_remove (events, evdata);
+ if (list->prev)
+ {
+ GList *next = list->next;
+ list->prev = g_list_remove (list->prev, evdata);
+ list = next;
+ }
+ else
+ {
+ spi_global_app_data->events = g_list_remove (events, evdata);
+ list = spi_global_app_data->events;
+ }
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]