wined3d: Fix a memory leak (spotted by Eric Pouech).
This commit is contained in:
parent
b6c325bfc0
commit
00ddebfafa
|
@ -73,7 +73,7 @@ DWORD minMipLookup[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1];
|
||||||
* function query some info from GL
|
* function query some info from GL
|
||||||
*/
|
*/
|
||||||
static WineD3D_Context* WineD3D_CreateFakeGLContext(void) {
|
static WineD3D_Context* WineD3D_CreateFakeGLContext(void) {
|
||||||
static WineD3D_Context ctx = { NULL, NULL, NULL, 0, 0 };
|
static WineD3D_Context ctx;
|
||||||
WineD3D_Context* ret = NULL;
|
WineD3D_Context* ret = NULL;
|
||||||
|
|
||||||
if (glXGetCurrentContext() == NULL) {
|
if (glXGetCurrentContext() == NULL) {
|
||||||
|
@ -84,6 +84,7 @@ static WineD3D_Context* WineD3D_CreateFakeGLContext(void) {
|
||||||
Visual* visual;
|
Visual* visual;
|
||||||
BOOL failed = FALSE;
|
BOOL failed = FALSE;
|
||||||
int num;
|
int num;
|
||||||
|
XVisualInfo *visInfo;
|
||||||
XWindowAttributes win_attr;
|
XWindowAttributes win_attr;
|
||||||
TRACE_(d3d_caps)("Creating Fake GL Context\n");
|
TRACE_(d3d_caps)("Creating Fake GL Context\n");
|
||||||
|
|
||||||
|
@ -102,8 +103,8 @@ static WineD3D_Context* WineD3D_CreateFakeGLContext(void) {
|
||||||
visual = DefaultVisual(ctx.display, DefaultScreen(ctx.display));
|
visual = DefaultVisual(ctx.display, DefaultScreen(ctx.display));
|
||||||
}
|
}
|
||||||
template.visualid = XVisualIDFromVisual(visual);
|
template.visualid = XVisualIDFromVisual(visual);
|
||||||
ctx.visInfo = XGetVisualInfo(ctx.display, VisualIDMask, &template, &num);
|
visInfo = XGetVisualInfo(ctx.display, VisualIDMask, &template, &num);
|
||||||
if (ctx.visInfo == NULL) {
|
if (visInfo == NULL) {
|
||||||
LEAVE_GL();
|
LEAVE_GL();
|
||||||
WARN_(d3d_caps)("Error creating visual info for capabilities initialization\n");
|
WARN_(d3d_caps)("Error creating visual info for capabilities initialization\n");
|
||||||
failed = TRUE;
|
failed = TRUE;
|
||||||
|
@ -111,7 +112,8 @@ static WineD3D_Context* WineD3D_CreateFakeGLContext(void) {
|
||||||
|
|
||||||
/* Create a GL context */
|
/* Create a GL context */
|
||||||
if (!failed) {
|
if (!failed) {
|
||||||
ctx.glCtx = glXCreateContext(ctx.display, ctx.visInfo, NULL, GL_TRUE);
|
ctx.glCtx = glXCreateContext(ctx.display, visInfo, NULL, GL_TRUE);
|
||||||
|
XFree( visInfo );
|
||||||
|
|
||||||
if (ctx.glCtx == NULL) {
|
if (ctx.glCtx == NULL) {
|
||||||
LEAVE_GL();
|
LEAVE_GL();
|
||||||
|
|
|
@ -1797,7 +1797,6 @@ typedef struct _WineD3D_GL_Info {
|
||||||
|
|
||||||
typedef struct _WineD3D_GLContext {
|
typedef struct _WineD3D_GLContext {
|
||||||
GLXContext glCtx;
|
GLXContext glCtx;
|
||||||
XVisualInfo* visInfo;
|
|
||||||
Display* display;
|
Display* display;
|
||||||
Drawable drawable;
|
Drawable drawable;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
|
|
Loading…
Reference in New Issue