Don't attempt to double-free struts, edges and regions if work areas have

2008-07-13  Elijah Newren  <newren gmail com>

        * src/core/workspace.c (meta_workspace_free): Don't attempt to
        double-free struts, edges and regions if work areas have already
        been invalidated at the time of freeing a workspace.
        Possible fix to #361804.

svn path=/trunk/; revision=3787
This commit is contained in:
Elijah Newren 2008-07-13 22:16:23 +00:00 committed by Thomas James Alexander Thurman
parent 24e63a0d2d
commit dacf784498
2 changed files with 24 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2008-07-13 Elijah Newren <newren gmail com>
* src/core/workspace.c (meta_workspace_free): Don't attempt to
double-free struts, edges and regions if work areas have already
been invalidated at the time of freeing a workspace.
Possible fix to #361804.
2008-07-12 Thomas Thurman <tthurman@gnome.org> 2008-07-12 Thomas Thurman <tthurman@gnome.org>
* src/core/constraints.c (do_screen_and_xinerama_relative_constraints): * src/core/constraints.c (do_screen_and_xinerama_relative_constraints):

View File

@ -116,15 +116,25 @@ meta_workspace_free (MetaWorkspace *workspace)
g_free (workspace->work_area_xinerama); g_free (workspace->work_area_xinerama);
g_list_free (workspace->mru_list); g_list_free (workspace->mru_list);
g_slist_free (workspace->all_struts);
g_list_free (workspace->list_containing_self); g_list_free (workspace->list_containing_self);
for (i = 0; i < screen->n_xinerama_infos; i++) /* screen.c:update_num_workspaces(), which calls us, removes windows from
meta_rectangle_free_list_and_elements (workspace->xinerama_region[i]); * workspaces first, which can cause the workareas on the workspace to be
g_free (workspace->xinerama_region); * invalidated (and hence for struts/regions/edges to be freed).
meta_rectangle_free_list_and_elements (workspace->screen_region); * So, no point trying to double free it; that causes a crash
meta_rectangle_free_list_and_elements (workspace->screen_edges); * anyway. #361804.
meta_rectangle_free_list_and_elements (workspace->xinerama_edges); */
if (!workspace->work_areas_invalid)
{
g_slist_free (workspace->all_struts);
for (i = 0; i < screen->n_xinerama_infos; i++)
meta_rectangle_free_list_and_elements (workspace->xinerama_region[i]);
g_free (workspace->xinerama_region);
meta_rectangle_free_list_and_elements (workspace->screen_region);
meta_rectangle_free_list_and_elements (workspace->screen_edges);
meta_rectangle_free_list_and_elements (workspace->xinerama_edges);
}
g_free (workspace); g_free (workspace);