Skip to content
This repository was archived by the owner on Dec 29, 2024. It is now read-only.

Commit 5aa92de

Browse files
authored
Deincermint ref count rather then calling the deconstructor (#175)
1 parent 2851f76 commit 5aa92de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/metatables.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ void LuaState::createObjectMetatable() {
458458

459459
// We need to manually uncount the ref
460460
if (Ref<RefCounted> ref = Object::cast_to<RefCounted>(arg1); ref.is_valid()) {
461-
ref->~RefCounted();
461+
ref->unreference();
462462
}
463463

464464
return 0;
@@ -804,7 +804,7 @@ void LuaState::createCallableExtraMetatable() {
804804
LUA_METAMETHOD_TEMPLATE(L, -1, "__gc", {
805805
// We need to manually uncount the ref
806806
if (Ref<RefCounted> ref = Object::cast_to<RefCounted>(arg1); ref.is_valid()) {
807-
ref->~RefCounted();
807+
ref->unreference();
808808
}
809809

810810
return 0;

0 commit comments

Comments
 (0)