Merge "libutils: disallow extending lifetime on stack"
This commit is contained in:
commit
ea25b4ba5b
1 changed files with 2 additions and 0 deletions
|
|
@ -797,6 +797,8 @@ RefBase::~RefBase()
|
|||
|
||||
void RefBase::extendObjectLifetime(int32_t mode)
|
||||
{
|
||||
check_not_on_stack(this);
|
||||
|
||||
// Must be happens-before ordered with respect to construction or any
|
||||
// operation that could destroy the object.
|
||||
mRefs->mFlags.fetch_or(mode, std::memory_order_relaxed);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue