diff --git a/ChangeLog b/ChangeLog index 5b4aed2a3..1c036f948 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-12-21 Paolo Borelli + + * src/core/core.c (meta_invalidate_default_icons): do not leak list. + + * src/core/edge-resistance.c + (meta_display_compute_resistance_and_snapping_edges): ditto. + + * src/core/workspace.c (meta_workspace_index): small cleanup in list + handling. + 2007-12-19 Havoc Pennington * src/core/display.c (meta_display_open): fix a third warning diff --git a/src/core/core.c b/src/core/core.c index 1454105e5..c9cd4e483 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -718,19 +718,18 @@ meta_core_increment_event_serial (Display *xdisplay) void meta_invalidate_default_icons (void) { - GSList *displays, *windows; + GSList *displays; for (displays = meta_displays_list (); displays != NULL; displays = displays->next) { + GSList *windows, *l; - for (windows = meta_display_list_windows (displays->data); - windows != NULL; - windows = windows->next) + windows = meta_display_list_windows (displays->data); + for (l = windows; l != NULL; l = l->next) { - - MetaWindow *window = (MetaWindow*)windows->data; + MetaWindow *window = (MetaWindow*)l->data; if (window->icon_cache.origin == USING_FALLBACK_ICON) { diff --git a/src/core/edge-resistance.c b/src/core/edge-resistance.c index d5c601128..409a4310d 100644 --- a/src/core/edge-resistance.c +++ b/src/core/edge-resistance.c @@ -1091,6 +1091,7 @@ meta_display_compute_resistance_and_snapping_edges (MetaDisplay *display) /* * 4th: Free the extra memory not needed and sort the list */ + g_list_free (stacked_windows); /* Free the memory used by the obscuring windows/docks lists */ g_slist_free (window_stacking); /* FIXME: Shouldn't there be a helper function to make this one line of code diff --git a/src/core/workspace.c b/src/core/workspace.c index 41bb80489..dca07e295 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -357,23 +357,14 @@ meta_workspace_activate (MetaWorkspace *workspace, int meta_workspace_index (MetaWorkspace *workspace) { - GList *tmp; - int i; + int ret; - i = 0; - tmp = workspace->screen->workspaces; - while (tmp != NULL) - { - if (tmp->data == workspace) - return i; + ret = g_list_index (workspace->screen->workspaces, workspace); - ++i; - - tmp = tmp->next; - } + if (ret < 0) + meta_bug ("Workspace does not exist to index!\n"); - meta_bug ("Workspace does not exist to index!\n"); - return -1; /* compiler warnings */ + return ret; } /* get windows contained on workspace, including workspace->windows