summaryrefslogtreecommitdiff
path: root/indra/llcommon/llrefcount.h
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-08-23 11:06:53 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2023-08-23 18:16:43 +0200
commit85efb85acfa098998c0f1249320f7e08288efdfc (patch)
tree9f1a438b2095cd365adbc726ce5b9cdf51cd6668 /indra/llcommon/llrefcount.h
parent720504595a09a94d10ff07926e8d1274dcab440c (diff)
SL-19299 Viewer crashes after change 'Pick a physics model:' dropdown
Diffstat (limited to 'indra/llcommon/llrefcount.h')
-rw-r--r--indra/llcommon/llrefcount.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h
index 2080da1565..2281bf87da 100644
--- a/indra/llcommon/llrefcount.h
+++ b/indra/llcommon/llrefcount.h
@@ -51,21 +51,17 @@ protected:
public:
LLRefCount();
- inline void validateRefCount() const
- {
- llassert(mRef > 0); // ref count below 0, likely corrupted
- llassert(mRef < gMaxRefCount); // ref count excessive, likely memory leak
- }
-
inline void ref() const
{
+ llassert(mRef != LL_REFCOUNT_FREE); // object is deleted
mRef++;
- validateRefCount();
+ llassert(mRef < gMaxRefCount); // ref count excessive, likely memory leak
}
inline S32 unref() const
{
- validateRefCount();
+ llassert(mRef != LL_REFCOUNT_FREE); // object is deleted
+ llassert(mRef > 0); // ref count below 1, likely corrupted
if (0 == --mRef)
{
mRef = LL_REFCOUNT_FREE; // set to nonsense yet recognizable value to aid in debugging