mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
[lua] Correctly call PropertiesIterator destructor using its __gc
This was detected by MSVC with its _ITERATOR_DEBUG_LEVEL=2 where orphan iterators are detected when the map/container is destroyed.
This commit is contained in:
parent
9f0491ddb6
commit
11dbb22efa
@ -150,6 +150,12 @@ int Properties_pairs(lua_State* L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
int PropertiesIterator_gc(lua_State* L)
|
||||
{
|
||||
get_obj<PropertiesIterator>(L, 1)->~PropertiesIterator();
|
||||
return 0;
|
||||
}
|
||||
|
||||
const luaL_Reg Properties_methods[] = {
|
||||
{ "__len", Properties_len },
|
||||
{ "__index", Properties_index },
|
||||
@ -159,6 +165,7 @@ const luaL_Reg Properties_methods[] = {
|
||||
};
|
||||
|
||||
const luaL_Reg PropertiesIterator_methods[] = {
|
||||
{ "__gc", PropertiesIterator_gc },
|
||||
{ nullptr, nullptr }
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user