Qt5OpenGL: release context when finished

This commit is contained in:
wmayer
2017-03-11 16:28:26 +01:00
parent 0bec4dbd63
commit f8a14fc69e
4 changed files with 14 additions and 9 deletions

View File

@@ -102,15 +102,6 @@ public:
{
SoContextHandler::addContextDestructionCallback(context_destruction_cb, this);
//SoBase::staticDataLock();
static bool init = false;
if (!init) {
std::string ext = (const char*)(glGetString(GL_EXTENSIONS));
vboAvailable = (ext.find("GL_ARB_vertex_buffer_object") != std::string::npos);
init = true;
}
//SoBase::staticDataUnlock();
updateVbo = false;
vboLoaded = false;
indice_array = 0;
@@ -451,6 +442,15 @@ void SoBrepFaceSet::renderColoredArray(SoMaterialBundle *const materials)
#else
void SoBrepFaceSet::GLRender(SoGLRenderAction *action)
{
//SoBase::staticDataLock();
static bool init = false;
if (!init) {
std::string ext = (const char*)(glGetString(GL_EXTENSIONS));
PRIVATE(this)->vboAvailable = (ext.find("GL_ARB_vertex_buffer_object") != std::string::npos);
init = true;
}
//SoBase::staticDataUnlock();
if (this->coordIndex.getNum() < 3)
return;
if (this->selectionIndex.getNum() > 0)