summaryrefslogtreecommitdiff
path: root/indra/llrender/llgl.cpp
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2011-04-26 15:04:22 -0700
committerbrad kittenbrink <brad@lindenlab.com>2011-04-26 15:04:22 -0700
commitd4b9db012e2b5195759f694792c392770112b42d (patch)
treefe89eda1b4985ee17b0eb16379dc07dbdc86f83a /indra/llrender/llgl.cpp
parent4bc90f24b3ced350ed44ca782f876af19af83c41 (diff)
FIX VWR-25609: crash on shutdown in LLGLNamePool::sInstances destructor
Diffstat (limited to 'indra/llrender/llgl.cpp')
-rw-r--r--indra/llrender/llgl.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index c86c89fa9b..b1a4051e96 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -105,7 +105,6 @@ LLMatrix4 gGLObliqueProjectionInverse;
#define LL_GL_NAME_POOLING 0
-LLGLNamePool::pool_list_t LLGLNamePool::sInstances;
std::list<LLGLUpdate*> LLGLUpdate::sGLQ;
#if (LL_WINDOWS || LL_LINUX || LL_SOLARIS) && !LL_MESA_HEADLESS
@@ -1920,22 +1919,8 @@ LLGLNamePool::LLGLNamePool()
{
}
-void LLGLNamePool::registerPool(LLGLNamePool* pool)
-{
- pool_list_t::iterator iter = std::find(sInstances.begin(), sInstances.end(), pool);
- if (iter == sInstances.end())
- {
- sInstances.push_back(pool);
- }
-}
-
LLGLNamePool::~LLGLNamePool()
{
- pool_list_t::iterator iter = std::find(sInstances.begin(), sInstances.end(), this);
- if (iter != sInstances.end())
- {
- sInstances.erase(iter);
- }
}
void LLGLNamePool::upkeep()
@@ -2004,20 +1989,22 @@ void LLGLNamePool::release(GLuint name)
void LLGLNamePool::upkeepPools()
{
LLMemType mt(LLMemType::MTYPE_UPKEEP_POOLS);
- for (pool_list_t::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
+ tracker_t::LLInstanceTrackerScopedGuard guard;
+ for (tracker_t::instance_iter iter = guard.beginInstances(); iter != guard.endInstances(); ++iter)
{
- LLGLNamePool* pool = *iter;
- pool->upkeep();
+ LLGLNamePool & pool = *iter;
+ pool.upkeep();
}
}
//static
void LLGLNamePool::cleanupPools()
{
- for (pool_list_t::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
+ tracker_t::LLInstanceTrackerScopedGuard guard;
+ for (tracker_t::instance_iter iter = guard.beginInstances(); iter != guard.endInstances(); ++iter)
{
- LLGLNamePool* pool = *iter;
- pool->cleanup();
+ LLGLNamePool & pool = *iter;
+ pool.cleanup();
}
}