aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libxcb/src/xcb_ext.c2
-rw-r--r--libxcb/src/xcb_windefs.h2
-rw-r--r--libxcb/src/xcb_xid.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/libxcb/src/xcb_ext.c b/libxcb/src/xcb_ext.c
index 68bb29bdf..c79c54de2 100644
--- a/libxcb/src/xcb_ext.c
+++ b/libxcb/src/xcb_ext.c
@@ -119,6 +119,8 @@ int _xcb_ext_init(xcb_connection_t *c)
void _xcb_ext_destroy(xcb_connection_t *c)
{
+ if (!c->ext.lock)
+ return; /* mutex is not initialised */
pthread_mutex_destroy(&c->ext.lock);
while(c->ext.extensions_size-- > 0)
if(c->ext.extensions[c->ext.extensions_size].tag == LAZY_FORCED)
diff --git a/libxcb/src/xcb_windefs.h b/libxcb/src/xcb_windefs.h
index 6b5217de4..cba0af3f2 100644
--- a/libxcb/src/xcb_windefs.h
+++ b/libxcb/src/xcb_windefs.h
@@ -43,6 +43,6 @@ typedef unsigned int in_addr_t;
#define HANDLE void *
typedef int pid_t;
-#define STDERR_FILENO stderr
+#define STDERR_FILENO 2
#endif /* xcb_windefs.h */
diff --git a/libxcb/src/xcb_xid.c b/libxcb/src/xcb_xid.c
index 3df5dbec6..b0de73f21 100644
--- a/libxcb/src/xcb_xid.c
+++ b/libxcb/src/xcb_xid.c
@@ -93,5 +93,7 @@ int _xcb_xid_init(xcb_connection_t *c)
void _xcb_xid_destroy(xcb_connection_t *c)
{
+ if (!c->xid.lock)
+ return; /* mutex was not initialised yet */
pthread_mutex_destroy(&c->xid.lock);
}