summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren gmail com>2008-07-13 22:16:23 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2008-07-13 22:16:23 +0000
commitdacf78449883f554541dedfc170c4ab8e83b7afe (patch)
tree851e12a20c96ac046092de2ab6aa78155cdf540f
parent24e63a0d2d1dd924026d7180f98784650044a718 (diff)
downloadmetacity-dacf78449883f554541dedfc170c4ab8e83b7afe.tar.gz
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
-rw-r--r--ChangeLog7
-rw-r--r--src/core/workspace.c24
2 files changed, 24 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 4752e5b9..a2b44024 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* src/core/constraints.c (do_screen_and_xinerama_relative_constraints):
diff --git a/src/core/workspace.c b/src/core/workspace.c
index d7985d5f..12355a06 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -116,15 +116,25 @@ meta_workspace_free (MetaWorkspace *workspace)
g_free (workspace->work_area_xinerama);
g_list_free (workspace->mru_list);
- g_slist_free (workspace->all_struts);
g_list_free (workspace->list_containing_self);
- 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);
+ /* screen.c:update_num_workspaces(), which calls us, removes windows from
+ * workspaces first, which can cause the workareas on the workspace to be
+ * invalidated (and hence for struts/regions/edges to be freed).
+ * So, no point trying to double free it; that causes a crash
+ * anyway. #361804.
+ */
+
+ 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);