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

Submitted by Sebasian Glita on Oct. 7, 2010, 2:47 a.m.

Details

Message ID 1286394459-26157-1-git-send-email-gseba@cs.upt.ro
State Deferred, archived
Headers show

Commit Message

Sebasian Glita Oct. 7, 2010, 2:47 a.m.
From: Sebastian Glita <gseba@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@cs.upt.ro>
---
 dix/dixutils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

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)