summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Plotnick <shrike@netaxs.com>2012-02-29 11:59:52 -0500
committerJulien Danjou <julien@danjou.info>2012-03-08 18:34:24 +0100
commit7ce51a20d9c95c982163ae340a4dff99dc5f05a6 (patch)
treeed337d65cb41924e2f3f6be5236d56e265a633dd
parent719555e141f3b9c2f420ecc9bec88471ea5a410e (diff)
Ensure that there's still a valid connection to the X server before attempting to send a request.
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--src/ext.c4
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;