[Xcb] [PATCH 2/7] Ensure that there's still a valid connection to the X server before attempting to send a request.

Alex Plotnick shrike at netaxs.com
Wed Feb 29 08:59:52 PST 2012


---
 src/ext.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/ext.c b/src/ext.c
index 2d622d9..6475850 100644
--- a/src/ext.c
+++ b/src/ext.c
@@ -113,6 +113,10 @@ xpybExt_send_request(xpybExt *self, PyObject *args, PyObject *kw)
 	    return NULL;
 	}
 
+    /* Check the connection */
+    if (xpybConn_invalid(self->conn))
+	return NULL;
+
     /* Set up request structure */
     xcb_req.count = 2;
     xcb_req.ext = (self->key != (xpybExtkey *)Py_None) ? &self->key->key : 0;
-- 
1.7.6



More information about the Xcb mailing list