Shut down the connection in all "fatal" error cases.
[free-sw/xcb/libxcb] / src / xcb_xlib.c
index 8cc6837..054bc2e 100644 (file)
 
 unsigned int XCBGetRequestSent(XCBConnection *c)
 {
-    unsigned int ret;
-    pthread_mutex_lock(&c->iolock);
-    ret = c->out.request;
-    pthread_mutex_unlock(&c->iolock);
-    return ret;
+    if(c->has_error)
+        return 0;
+    return c->out.request;
 }
 
 pthread_mutex_t *XCBGetIOLock(XCBConnection *c)
 {
+    if(c->has_error)
+        return 0;
     return &c->iolock;
 }