summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/llrender/llglslshader.cpp9
-rwxr-xr-xindra/newview/llviewerwindow.cpp7
2 files changed, 9 insertions, 7 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 52b8de8365..750e35a71a 100755
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -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);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f96c4b7bf0..d3416ec5fc 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -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;
}