mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
Avoid a memory leak when checking which workspace(s) a window is on. Fixes
2006-02-10 Thomas Thurman <thomas thurman org uk> Avoid a memory leak when checking which workspace(s) a window is on. Fixes #322059. * src/workspace.h (struct MetaWorkspace): * src/workspace.c (meta_workspace_new, meta_workspace_free): added list_containing_self member to MetaWorkspace * src/window.c (meta_window_get_workspaces): use window->workspace->list_containing_self instead of allocating (and leaking) such a list on the fly.
This commit is contained in:
parent
4b6a87acb5
commit
7aebefad3c
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
2006-02-10 Thomas Thurman <thomas thurman org uk>
|
||||||
|
|
||||||
|
Avoid a memory leak when checking which workspace(s) a window is
|
||||||
|
on. Fixes #322059.
|
||||||
|
|
||||||
|
* src/workspace.h (struct MetaWorkspace):
|
||||||
|
* src/workspace.c (meta_workspace_new, meta_workspace_free):
|
||||||
|
added list_containing_self member to MetaWorkspace
|
||||||
|
|
||||||
|
* src/window.c (meta_window_get_workspaces): use
|
||||||
|
window->workspace->list_containing_self instead of allocating (and
|
||||||
|
leaking) such a list on the fly.
|
||||||
|
|
||||||
2006-02-09 Thomas Thurman <thomas thurman org uk>
|
2006-02-09 Thomas Thurman <thomas thurman org uk>
|
||||||
|
|
||||||
* src/testboxes.c (test_regions_okay, test_clamping_to_region):
|
* src/testboxes.c (test_regions_okay, test_clamping_to_region):
|
||||||
|
@ -5677,7 +5677,7 @@ meta_window_get_workspaces (MetaWindow *window)
|
|||||||
if (window->on_all_workspaces)
|
if (window->on_all_workspaces)
|
||||||
return window->screen->workspaces;
|
return window->screen->workspaces;
|
||||||
else
|
else
|
||||||
return g_list_prepend (NULL, window->workspace);
|
return window->workspace->list_containing_self;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -68,6 +68,7 @@ meta_workspace_new (MetaScreen *screen)
|
|||||||
workspace->xinerama_region = NULL;
|
workspace->xinerama_region = NULL;
|
||||||
workspace->screen_edges = NULL;
|
workspace->screen_edges = NULL;
|
||||||
workspace->xinerama_edges = NULL;
|
workspace->xinerama_edges = NULL;
|
||||||
|
workspace->list_containing_self = g_list_prepend (NULL, workspace);
|
||||||
|
|
||||||
workspace->all_struts = NULL;
|
workspace->all_struts = NULL;
|
||||||
|
|
||||||
@ -114,6 +115,7 @@ meta_workspace_free (MetaWorkspace *workspace)
|
|||||||
|
|
||||||
g_list_free (workspace->mru_list);
|
g_list_free (workspace->mru_list);
|
||||||
g_slist_free (workspace->all_struts);
|
g_slist_free (workspace->all_struts);
|
||||||
|
g_list_free (workspace->list_containing_self);
|
||||||
|
|
||||||
for (i = 0; i < screen->n_xinerama_infos; i++)
|
for (i = 0; i < screen->n_xinerama_infos; i++)
|
||||||
meta_rectangle_free_list_and_elements (workspace->xinerama_region[i]);
|
meta_rectangle_free_list_and_elements (workspace->xinerama_region[i]);
|
||||||
|
@ -43,6 +43,8 @@ struct _MetaWorkspace
|
|||||||
GList *windows;
|
GList *windows;
|
||||||
GList *mru_list;
|
GList *mru_list;
|
||||||
|
|
||||||
|
GList *list_containing_self;
|
||||||
|
|
||||||
MetaRectangle work_area_screen;
|
MetaRectangle work_area_screen;
|
||||||
MetaRectangle *work_area_xinerama;
|
MetaRectangle *work_area_xinerama;
|
||||||
GList *screen_region;
|
GList *screen_region;
|
||||||
|
Loading…
Reference in New Issue
Block a user