update src/util/slab.h.

Signed-off-by: 董洁 <dongjie52@h-partners.com>
This commit is contained in:
董洁 2024-11-14 01:46:06 +00:00 committed by Gitee
parent 2dc0c73cc5
commit d47a4c0ca7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -60,6 +60,7 @@ public:
// NOTE: call destructor before FreeMem
static void FreeMem(T* t)
{
t->~T();
// unlock()内部lck记录锁的状态为非持有状态析构时访问状态变量为非持有状态则不访问实际持有的mutex
// return之前的lck析构不产生UAF问题因为return之前随着root析构锁的内存被释放
Instance()->free(t);