SL-17276 Potential fix for crash on shutdown on mac.

meow-7.2.2
Dave Parks 2022-04-26 16:38:47 -05:00
parent 436544a51a
commit a00a569ac8
5 changed files with 21 additions and 2 deletions

View File

@ -852,6 +852,7 @@ LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32
LLSpatialPartition::~LLSpatialPartition()
{
cleanup();
}
LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)

View File

@ -1325,8 +1325,13 @@ LLViewerOctreePartition::LLViewerOctreePartition() :
LLViewerOctreePartition::~LLViewerOctreePartition()
{
delete mOctree;
mOctree = NULL;
cleanup();
}
void LLViewerOctreePartition::cleanup()
{
delete mOctree;
mOctree = nullptr;
}
BOOL LLViewerOctreePartition::isOcclusionEnabled()
@ -1334,6 +1339,7 @@ BOOL LLViewerOctreePartition::isOcclusionEnabled()
return mOcclusionEnabled || LLPipeline::sUseOcclusion > 2;
}
//-----------------------------------------------------------------------------------
//class LLViewerOctreeCull definitions
//-----------------------------------------------------------------------------------

View File

@ -352,6 +352,10 @@ public:
virtual S32 cull(LLCamera &camera, bool do_occlusion) = 0;
BOOL isOcclusionEnabled();
protected:
// MUST call from destructor of any derived classes (SL-17276)
void cleanup();
public:
U32 mPartitionType;
U32 mDrawableType;

View File

@ -632,6 +632,13 @@ LLVOCachePartition::LLVOCachePartition(LLViewerRegion* regionp)
new LLVOCacheGroup(mOctree, this);
}
LLVOCachePartition::~LLVOCachePartition()
{
// SL-17276 make sure to do base class cleanup while this instance
// can still be treated as an LLVOCachePartition
cleanup();
}
bool LLVOCachePartition::addEntry(LLViewerOctreeEntry* entry)
{
llassert(entry->hasVOCacheEntry());

View File

@ -189,6 +189,7 @@ class LLVOCachePartition : public LLViewerOctreePartition
{
public:
LLVOCachePartition(LLViewerRegion* regionp);
virtual ~LLVOCachePartition();
bool addEntry(LLViewerOctreeEntry* entry);
void removeEntry(LLViewerOctreeEntry* entry);