MAINT-1109 FIXED Toggling graphics options causes viewer memory to increase, eventually causing the rendering pipeline to fall over and crashing the viewer

Patchset #2
meow-7.2.2
ruslantproductengine 2016-03-10 19:50:12 +02:00
parent debc51af6b
commit 173886fec3
2 changed files with 9 additions and 7 deletions

View File

@ -345,15 +345,10 @@ void LLGLSLShader::unloadInternal()
GLhandleARB obj[1024];
GLsizei count;
glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj);
glGetAttachedObjectsARB(mProgramObject, sizeof(obj)/sizeof(obj[0]), &count, obj);
for (GLsizei i = 0; i < count; i++)
{
#if !LL_DARWIN
if (glIsProgramARB(obj[i]))
#endif
{
glDeleteObjectARB(obj[i]);
}
glDeleteObjectARB(obj[i]);
}
glDeleteObjectARB(mProgramObject);

View File

@ -4951,6 +4951,13 @@ void LLViewerWindow::stopGL(BOOL save_state)
gGLManager.mIsDisabled = TRUE;
stop_glerror();
//unload shader's
while (LLGLSLShader::sInstances.size())
{
LLGLSLShader* shader = *(LLGLSLShader::sInstances.begin());
shader->unload();
}
LL_INFOS() << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemory.value() << " bytes" << LL_ENDL;
}