[PATCH] Xorg restarted each session after some activity (20-30 minutes).

Sebasian Glita gseba at cs.upt.ro
Wed Oct 6 12:47:39 PDT 2010


From: Sebastian Glita <gseba at cs.upt.ro>

A simple fixup in "dixutils.c:_CallCallbacks":
- by moving recursion count check *before* list iteration and actual callbacks'
invocation;
- can say for sure, though, whether counters (member `int inCallback' from
"include/dixstruct.h:171:CallbackListRec" structure) were supposed to grow
greater than 1 before iteration,
- so cannot ascertain whether the new behavior is required.

The mutual recursive functions' chain:

1. dix/dixutils.c:CallCallbacks:877
2. dix/dixutils.c:_CallCallbacks:743
3. record/record.c:RecordFlushAllContexts:867
4. record/record.c:RecordFlushReplyBuffer:251
5. os/io.c:WriteToClient:824

Signed-off-by: Sebastian Glita <gseba at cs.upt.ro>
---
 dix/dixutils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dix/dixutils.c b/dix/dixutils.c
index 470bb5d..e3c9c22 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -737,6 +737,8 @@ _CallCallbacks(
     CallbackListPtr cbl = *pcbl;
     CallbackPtr     cbr, pcbr;
 
+    if (cbl->inCallback) return;
+
     ++(cbl->inCallback);
     for (cbr = cbl->list; cbr != NULL; cbr = cbr->next)
     {
@@ -744,8 +746,6 @@ _CallCallbacks(
     }
     --(cbl->inCallback);
 
-    if (cbl->inCallback) return;
-
     /* Was the entire list marked for deletion? */
 
     if (cbl->deleted)
-- 
1.7.3.1



More information about the xorg-devel mailing list