summaryrefslogtreecommitdiff
path: root/indra/llcommon/llrefcount.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-02-23 16:51:33 -0600
committerDave Parks <davep@lindenlab.com>2022-02-23 16:51:33 -0600
commitd9a68339d5aa18af349e347d6ed74bc01824cec7 (patch)
treecb8dd1c146499d57daa6798495a7540c691bdddb /indra/llcommon/llrefcount.cpp
parent65a28c5d7dc54dc9e263da4b19229fb5f86a1c62 (diff)
SL-16815 and SL-16906 Avoid redundant bumpmap generation, add some assertions around ref counting and (hack) fix crash on shutdown from dangling texture reference (reduced to 1 dangling texture from several hundred, can't find the remaining reference).
Diffstat (limited to 'indra/llcommon/llrefcount.cpp')
-rw-r--r--indra/llcommon/llrefcount.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/llcommon/llrefcount.cpp b/indra/llcommon/llrefcount.cpp
index 29a5ca6f24..5cbd346411 100644
--- a/indra/llcommon/llrefcount.cpp
+++ b/indra/llcommon/llrefcount.cpp
@@ -29,6 +29,9 @@
#include "llerror.h"
+// maximum reference count before sounding memory leak alarm
+const S32 gMaxRefCount = 65536;
+
LLRefCount::LLRefCount(const LLRefCount& other)
: mRef(0)
{
@@ -47,7 +50,7 @@ LLRefCount::LLRefCount() :
LLRefCount::~LLRefCount()
{
- if (mRef != 0)
+ if (mRef != LL_REFCOUNT_FREE && mRef != 0)
{
LL_ERRS() << "deleting non-zero reference" << LL_ENDL;
}