[mutter/wip/wayland: 1/4] screen: Don't ref workspace->screen after freeing workspace



commit 36806a7444122ff709c5f956f8d39c0f4aef509d
Author: Robert Bragg <robert linux intel com>
Date:   Fri Jan 20 15:41:28 2012 +0000

    screen: Don't ref workspace->screen after freeing workspace
    
    In meta_screen_remove_workspace its possible that the workspace will be
    disposed before we call meta_screen_set_active_workspace_hint to update
    the active workspace index so we make sure to use the screen pointer
    passed as an argument to meta_screen_remove_workspace() instead of
    referring to the workspace->screen pointer which might cause a crash if
    workspace was indeed freed.

 src/core/screen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/core/screen.c b/src/core/screen.c
index 4010c7a..5c94b2a 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1488,7 +1488,7 @@ meta_screen_remove_workspace (MetaScreen *screen, MetaWorkspace *workspace,
   /* If deleting a workspace before the current workspace, the active
    * workspace index changes, so we need to update that hint */
   if (active_index_changed)
-      meta_screen_set_active_workspace_hint (workspace->screen);
+      meta_screen_set_active_workspace_hint (screen);
 
   l = next;
   while (l)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]