diff options
author | Stinson Linden <stinson@lindenlab.com> | 2014-04-24 01:50:17 +0100 |
---|---|---|
committer | Stinson Linden <stinson@lindenlab.com> | 2014-04-24 01:50:17 +0100 |
commit | b24552e313dc971d7750025c4b6f953ee3155ea9 (patch) | |
tree | a360a3c0e41ea515ef7c0393fca6f5b77b446109 /indra/newview | |
parent | 592b7e2fdff3f5a405632cec5870e385a2b3f367 (diff) |
MAINT-4009: Ensuring that the shader manager instance is released during cleanup.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llviewershadermgr.cpp | 10 | ||||
-rwxr-xr-x | indra/newview/llviewershadermgr.h | 1 | ||||
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 6 |
3 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 9d2a4a50e1..dafe2cafec 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -355,6 +355,16 @@ LLViewerShaderMgr * LLViewerShaderMgr::instance() return static_cast<LLViewerShaderMgr*>(sInstance); } +// static +void LLViewerShaderMgr::releaseInstance() +{ + if (sInstance != NULL) + { + delete sInstance; + sInstance = NULL; + } +} + void LLViewerShaderMgr::initAttribsAndUniforms(void) { if (mReservedAttribs.empty()) diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 42147fdd29..923aa522ad 100755 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -43,6 +43,7 @@ public: // singleton pattern implementation static LLViewerShaderMgr * instance(); + static void releaseInstance(); void initAttribsAndUniforms(void); void setShaders(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index aa75bae712..3dad782715 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2153,6 +2153,12 @@ LLViewerWindow::~LLViewerWindow() delete mDebugText; mDebugText = NULL; + + if (LLViewerShaderMgr::sInitialized) + { + LLViewerShaderMgr::releaseInstance(); + LLViewerShaderMgr::sInitialized = FALSE; + } } |