fix memory leak of group_windows, and don't use the variable name "tmp"

2002-10-17  Havoc Pennington  <hp@redhat.com>

	* src/stack.c (apply_constraints): fix memory leak of
	group_windows, and don't use the variable name "tmp" twice. Shadow
	variables bad.
This commit is contained in:
Havoc Pennington 2002-10-17 16:07:50 +00:00 committed by Havoc Pennington
parent aa62466091
commit 3da0b1c7d9
2 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2002-10-17 Havoc Pennington <hp@redhat.com>
* src/stack.c (apply_constraints): fix memory leak of
group_windows, and don't use the variable name "tmp" twice. Shadow
variables bad.
2002-10-17 Havoc Pennington <hp@redhat.com> 2002-10-17 Havoc Pennington <hp@redhat.com>
* src/tools/metacity-window-demo.c (dialog_cb): add code to create * src/tools/metacity-window-demo.c (dialog_cb): add code to create

View File

@ -436,7 +436,7 @@ apply_constraints (GList *list)
w->type == META_WINDOW_UTILITY)) w->type == META_WINDOW_UTILITY))
{ {
GSList *group_windows; GSList *group_windows;
GSList *tmp; GSList *tmp2;
MetaGroup *group; MetaGroup *group;
group = meta_window_get_group (w); group = meta_window_get_group (w);
@ -446,11 +446,11 @@ apply_constraints (GList *list)
else else
group_windows = NULL; group_windows = NULL;
tmp = group_windows; tmp2 = group_windows;
while (tmp != NULL) while (tmp2 != NULL)
{ {
MetaWindow *group_window = tmp->data; MetaWindow *group_window = tmp2->data;
if (!(meta_window_is_ancestor_of_transient (w, group_window))) if (!(meta_window_is_ancestor_of_transient (w, group_window)))
{ {
@ -459,8 +459,10 @@ apply_constraints (GList *list)
ensure_above (w, group_window); ensure_above (w, group_window);
} }
tmp = tmp->next; tmp2 = tmp2->next;
} }
g_slist_free (group_windows);
} }
else if (w->xtransient_for != None && else if (w->xtransient_for != None &&
!w->transient_parent_is_root_window) !w->transient_parent_is_root_window)