diff options
Diffstat (limited to '')
-rw-r--r-- | src/deep.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/deep.cpp b/src/deep.cpp index 398e13f..bc0b73c 100644 --- a/src/deep.cpp +++ b/src/deep.cpp | |||
@@ -131,6 +131,7 @@ int DeepFactory::DeepGC(lua_State* const L_) | |||
131 | void DeepFactory::DeleteDeepObject(lua_State* const L_, DeepPrelude* const o_) | 131 | void DeepFactory::DeleteDeepObject(lua_State* const L_, DeepPrelude* const o_) |
132 | { | 132 | { |
133 | STACK_CHECK_START_REL(L_, 0); | 133 | STACK_CHECK_START_REL(L_, 0); |
134 | o_->factory.deepObjectCount.fetch_sub(1, std::memory_order_relaxed); | ||
134 | o_->factory.deleteDeepObjectInternal(L_, o_); | 135 | o_->factory.deleteDeepObjectInternal(L_, o_); |
135 | STACK_CHECK(L_, 0); | 136 | STACK_CHECK(L_, 0); |
136 | } | 137 | } |
@@ -318,6 +319,7 @@ void DeepFactory::pushDeepUserdata(DestState const L_, UserValueCount const nuv_ | |||
318 | if (_prelude == nullptr) { | 319 | if (_prelude == nullptr) { |
319 | raise_luaL_error(L_, "DeepFactory::newDeepObjectInternal failed to create deep userdata (out of memory)"); | 320 | raise_luaL_error(L_, "DeepFactory::newDeepObjectInternal failed to create deep userdata (out of memory)"); |
320 | } | 321 | } |
322 | deepObjectCount.fetch_add(1, std::memory_order_relaxed); | ||
321 | 323 | ||
322 | if (_prelude->magic != kDeepVersion) { | 324 | if (_prelude->magic != kDeepVersion) { |
323 | // just in case, don't leak the newly allocated deep userdata object | 325 | // just in case, don't leak the newly allocated deep userdata object |