From 0794a64b9d7ae0d526a6342db34b1ce6aa2c8938 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 24 Aug 2023 09:22:38 +0300 Subject: [PATCH] Fix lua object added to container error The reference count of the deleted object was changed, instead of the object that it was merged into. --- src/nhlobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhlobj.c b/src/nhlobj.c index 8e65aa239..4eef6ad9d 100644 --- a/src/nhlobj.c +++ b/src/nhlobj.c @@ -126,8 +126,8 @@ l_obj_add_to_container(lua_State *L) /* was lo->obj merged? */ if (otmp != lo->obj) { - lo->obj->lua_ref_cnt += refs; lo->obj = otmp; + lo->obj->lua_ref_cnt += refs; } return 0;