From 85efb85acfa098998c0f1249320f7e08288efdfc Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 23 Aug 2023 11:06:53 +0200 Subject: SL-19299 Viewer crashes after change 'Pick a physics model:' dropdown --- indra/llcommon/llrefcount.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'indra/llcommon/llrefcount.h') 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 -- cgit v1.2.3