WeaselGames / godot_luaAPI

Godot LuaAPI
https://luaapi.weaselgames.info
Other
361 stars 27 forks source link

Fix some regression issues #130

Closed Trey2k closed 1 year ago

Trey2k commented 1 year ago

The previous set of changes caused some regression due to the differences of how GDExtension and Modules work. memove is needed for GDExtension because all Variants for it are pointers to Variants living in the engine, assigning to a null Variant allocated by lua will cause a null pointer deref. Therefore we skip the assignment operator by using memmove. We need to do some manually ref counting to make this work.

For modules memmove caused a lot more issues so this PR has the Module version use the assignment operator.

The other major change was we now test if a Callable is custom and send it as a blank LuaCallableExtra instead. We do this to create a wrapper to the callable custom which will always have a RefCounted. Without this we have no way to manually increment the ref counter so it gets cleaned up.

There was also some steps missing to fully expose the GC options which have been fixed.

Trey2k commented 1 year ago

LuaJIT module tests failed, but I can not replicate on my system. I mustve ran tests 20 or 30 times in a row without any crash like what happened on the runner. Ive also run about 10 iteration of tests using the same bin from the github actions build. And since it passed on a rerun I am going to be merging this. Leaving this comment as note though in case something pops up.