xfce4-session: backport patch to fix a crash
[openembedded.git] / recipes / xfce-base / xfce4-session / fix_properties_crash.patch
1 commit 76b1fea1a36401d8f9de1617e2f7e41348a63292
2 Author: Brian J. Tarricone <brian@tarricone.org>
3 Date:   Sun Oct 18 17:24:44 2009 -0700
4
5     fix crash when properties are freed in failure handler (bug 5797)
6
7 diff --git a/xfce4-session/xfsm-startup.c b/xfce4-session/xfsm-startup.c
8 index caa34f2..ddf6ad4 100644
9 --- a/xfce4-session/xfsm-startup.c
10 +++ b/xfce4-session/xfsm-startup.c
11 @@ -690,6 +690,9 @@ xfsm_startup_child_watch (GPid     pid,
12    xfsm_verbose ("Client Id = %s, PID %d exited with status %d\n",
13                  cwdata->properties->client_id, (gint)pid, status);
14  
15 +  cwdata->properties->child_watch_id = 0;
16 +  cwdata->properties->pid = -1;
17 +
18    starting_properties = xfsm_manager_get_queue (cwdata->manager, XFSM_MANAGER_QUEUE_STARTING_PROPS);
19    if (g_queue_find (starting_properties, cwdata->properties) != NULL)
20      {
21 @@ -698,8 +701,9 @@ xfsm_startup_child_watch (GPid     pid,
22        xfsm_startup_handle_failed_startup (cwdata->properties, cwdata->manager);
23      }
24  
25 -  cwdata->properties->child_watch_id = 0;
26 -  cwdata->properties->pid = -1;
27 +  /* NOTE: cwdata->properties could have been freed by
28 +   * xfsm_startup_handle_failed_startup() above, so don't try to access
29 +   * any of its members here. */
30  
31    g_spawn_close_pid (pid);
32  }