Free the GLX framebuffer configurations
Adds missing XFree for a glXChooseFBConfig Change-Id: I4c30341f90666170dac5d90b0c65d1deff4e0818 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit da898fca026f629be0ed234f0a89a99bc662385d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
600a5c2035
commit
23c49af8a3
@ -395,14 +395,19 @@ QGLXContext::QGLXContext(Display *display, GLXContext context, void *visualInfo,
|
|||||||
int numConfigs = 0;
|
int numConfigs = 0;
|
||||||
static const int attribs[] = { GLX_FBCONFIG_ID, configId, None };
|
static const int attribs[] = { GLX_FBCONFIG_ID, configId, None };
|
||||||
configs = glXChooseFBConfig(m_display, screenNumber, attribs, &numConfigs);
|
configs = glXChooseFBConfig(m_display, screenNumber, attribs, &numConfigs);
|
||||||
if (!configs || numConfigs < 1) {
|
if (!configs) {
|
||||||
|
qWarning("QGLXContext: Failed to find config(invalid arguments for glXChooseFBConfig)");
|
||||||
|
return;
|
||||||
|
} else if (numConfigs < 1) {
|
||||||
qWarning("QGLXContext: Failed to find config");
|
qWarning("QGLXContext: Failed to find config");
|
||||||
|
XFree(configs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (configs && numConfigs > 1) // this is suspicious so warn but let it continue
|
if (configs && numConfigs > 1) // this is suspicious so warn but let it continue
|
||||||
qWarning("QGLXContext: Multiple configs for FBConfig ID %d", configId);
|
qWarning("QGLXContext: Multiple configs for FBConfig ID %d", configId);
|
||||||
|
|
||||||
m_config = configs[0];
|
m_config = configs[0];
|
||||||
|
XFree(configs);
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_ASSERT(vinfo || m_config);
|
Q_ASSERT(vinfo || m_config);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user