summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <chalserogers@gmail.com>2007-09-23 18:35:02 +1000
committerChristopher James Halse Rogers <chalserogers@gmail.com>2007-09-23 18:35:02 +1000
commitd28696831980fb3226638f48730d3566cb25613d (patch)
tree9d7ad593be60198c4bd50a5f25ff8060d26b8565
parent3beb80eeb266cdf2f452b8e64a49bbdd6557fe76 (diff)
downloadsession-xdg-d28696831980fb3226638f48730d3566cb25613d.tar.gz
session-xdg-d28696831980fb3226638f48730d3566cb25613d.tar.bz2
Fix segfault on startup when a previous session ID is specified
It is important to remember to assign global pointers before calling functions that try to dereference them! :)
-rw-r--r--session.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/session.c b/session.c
index 6c4bb14..b53aad9 100644
--- a/session.c
+++ b/session.c
@@ -814,6 +814,8 @@ sessionInitDisplay (CompPlugin *p, CompDisplay *d)
if (!sd)
return FALSE;
+ d->privates[displayPrivateIndex].ptr = sd;
+
sd->visibleNameAtom = XInternAtom (d->display,
"_NET_WM_VISIBLE_NAME", 0);
sd->clientIdAtom = XInternAtom (d->display,
@@ -838,8 +840,6 @@ sessionInitDisplay (CompPlugin *p, CompDisplay *d)
if (previousId != NULL)
loadState (d, previousId);
- d->privates[displayPrivateIndex].ptr = sd;
-
return TRUE;
}