From 78dbd1acf987c35340235a12e86199c6878bd0cf Mon Sep 17 00:00:00 2001 From: sleuth Date: Sat, 8 Mar 2003 23:55:57 +0000 Subject: [PATCH] Plug cursor leak in new XCursor support, only impacts those additions. Plug a pre-existing key_grab leak. e17 was leaving passive grabs in the server and not releasing them. Looks like a bug in the new config parts. Kevin Brosius SVN revision: 6755 --- src/config.c | 9 +++++++++ src/cursors.c | 33 ++++++++++++++++++--------------- src/data.c | 7 +++++-- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/config.c b/src/config.c index 16a0e63d2..17cc9c167 100644 --- a/src/config.c +++ b/src/config.c @@ -311,6 +311,15 @@ e_config_behavior_changed(E_Observer * observer, E_Observee * observee, if (config_data) { + for (l = config_data->actions; l; l = l->next) + { + E_Action *a; + + a = l->data; + e_object_unref((E_Object *)a); + l->data = NULL; + } + e_data_free(cfg_config, (char *)config_data); FREE(config_data); } diff --git a/src/cursors.c b/src/cursors.c index 690652f75..963db122c 100644 --- a/src/cursors.c +++ b/src/cursors.c @@ -296,10 +296,23 @@ e_cursors_display_in_window(Window win, char *type) if (c) { - c->cursor = - ecore_cursor_new(pmap, mask, hx, hy, fr, fg, fb, br, bg, bb); - ecore_pixmap_free(pmap); - ecore_pixmap_free(mask); + /* If behavior.db has /desktops/cursors/native == 1, then use */ + /* images installed */ + /* by E, else use X cursors by cursorfont id. */ + /* Use E's pixmap? */ + if(config_data->desktops->e_native_cursors) + { + c->cursor = + ecore_cursor_new(pmap, mask, hx, hy, fr, fg, fb, br, bg, bb); + ecore_pixmap_free(pmap); + ecore_pixmap_free(mask); + } + else + { + /* No, use X cursors */ + c->cursor = + XCreateFontCursor(ecore_display_get(), c->x_cursor_id); + } cursors = evas_list_append(cursors, c); } #if 0 @@ -308,17 +321,7 @@ e_cursors_display_in_window(Window win, char *type) } if (c) { - /* If behavior.db has /desktops/cursors/native == 1, then use */ - /* images installed */ - /* by E, else use X cursors by cursorfont id. */ - if(config_data->desktops->e_native_cursors) - ecore_cursor_set(win, c->cursor); - else - { - Cursor x_cursor; - x_cursor = XCreateFontCursor(ecore_display_get(), c->x_cursor_id); - ecore_cursor_set(win, x_cursor); - } + ecore_cursor_set(win, c->cursor); } else { diff --git a/src/data.c b/src/data.c index a3a9eb927..4e9fc7604 100644 --- a/src/data.c +++ b/src/data.c @@ -189,8 +189,11 @@ e_data_free(E_Data_Base_Type * type, char *data) data2 = l2->data; l2 = evas_list_remove(l2, data2); - e_data_free(node->sub_type, (char *)data2); - FREE(data2); + if(data2) + { + e_data_free(node->sub_type, (char *)data2); + FREE(data2); + } } } break;