Handle XC-MISC request failure when allocating new XIDs. (fixes #7001)

This commit is contained in:
Jamey Sharp 2006-09-09 15:52:37 -07:00
parent f6d4fc007f
commit 81d6fd64c0

View File

@ -41,6 +41,11 @@ CARD32 XCBGenerateID(XCBConnection *c)
{ {
XCBXCMiscGetXIDRangeRep *range; XCBXCMiscGetXIDRangeRep *range;
range = XCBXCMiscGetXIDRangeReply(c, XCBXCMiscGetXIDRange(c), 0); range = XCBXCMiscGetXIDRangeReply(c, XCBXCMiscGetXIDRange(c), 0);
if(!range)
{
pthread_mutex_unlock(&c->xid.lock);
return -1;
}
c->xid.last = range->start_id; c->xid.last = range->start_id;
c->xid.max = range->start_id + (range->count - 1) * c->xid.inc; c->xid.max = range->start_id + (range->count - 1) * c->xid.inc;
free(range); free(range);