glx: Initialize all context fields together
v2: Fix whitespace error noticed by Christopher James Halse Rogers. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
This commit is contained in:
parent
befa76d251
commit
0db76e5f77
|
@ -290,26 +290,10 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
|
|||
return BadAlloc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initially, setup the part of the context that could be used by
|
||||
** a GL core that needs windowing information (e.g., Mesa).
|
||||
/* Initialize the GLXcontext structure.
|
||||
*/
|
||||
glxc->pGlxScreen = pGlxScreen;
|
||||
glxc->config = config;
|
||||
|
||||
/*
|
||||
** Register this context as a resource.
|
||||
*/
|
||||
if (!AddResource(gcId, __glXContextRes, (pointer) glxc)) {
|
||||
(*glxc->destroy) (glxc);
|
||||
client->errorValue = gcId;
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Finally, now that everything is working, setup the rest of the
|
||||
** context.
|
||||
*/
|
||||
glxc->id = gcId;
|
||||
glxc->share_id = shareList;
|
||||
glxc->idExists = GL_TRUE;
|
||||
|
@ -317,6 +301,14 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
|
|||
glxc->isDirect = isDirect;
|
||||
glxc->renderMode = GL_RENDER;
|
||||
|
||||
/* Register this context as a resource.
|
||||
*/
|
||||
if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
|
||||
(*glxc->destroy) (glxc);
|
||||
client->errorValue = gcId;
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
__glXAddToContextList(glxc);
|
||||
|
||||
return Success;
|
||||
|
|
Loading…
Reference in New Issue
Block a user