mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 00:10:05 +01:00
GLX: Free the tag of the old context later
In CommonMakeCurrent() function, the tag of the old context is freed
before the new context is made current. This is problematic because if
the CommonMakeNewCurrent() function fails, the tag of the old context
ends up being removed, even though it is still active. This causes
subsequent glXMakeCurrent() or glXMakeContextCurrent() requests to
generate a GLXBadContextTag error.
This change moves the function call that frees the old tag to a location
where the result of CommonMakeNewCurrent() call is known and it is safe
to free it.
Signed-off-by: Doğukan Korkmaztürk <dkorkmazturk@nvidia.com>
(cherry picked from commit 4781f2a5a8)
This commit is contained in:
parent
e982ca4420
commit
cedf933c7c
1 changed files with 3 additions and 4 deletions
|
|
@ -165,9 +165,6 @@ static int CommonLoseCurrent(ClientPtr client, GlxContextTagInfo *tagInfo)
|
|||
tagInfo->tag, // No old context tag,
|
||||
None, None, None, 0);
|
||||
|
||||
if (ret == Success) {
|
||||
GlxFreeContextTag(tagInfo);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +256,6 @@ static int CommonMakeCurrent(ClientPtr client,
|
|||
if (ret != Success) {
|
||||
return ret;
|
||||
}
|
||||
oldTag = NULL;
|
||||
}
|
||||
|
||||
if (newVendor != NULL) {
|
||||
|
|
@ -270,6 +266,9 @@ static int CommonMakeCurrent(ClientPtr client,
|
|||
} else {
|
||||
reply.contextTag = 0;
|
||||
}
|
||||
|
||||
GlxFreeContextTag(oldTag);
|
||||
oldTag = NULL;
|
||||
}
|
||||
|
||||
reply.contextTag = GlxCheckSwap(client, reply.contextTag);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue