Closed theanimatorspal closed 4 months ago
Have you tried capturing inFunction
by value? maybe it's a lifetime issue?
Yup. " I also tried setting sol::function instead of sol::function&," I said.
I also tried setting sol::function instead of sol::function&,
This means that you have a temporary argument sol::function inFunction
and then you capture that temporary argument by reference in the next lambda (inWindow.SetDrawCallBack
).
Ah man, thank You.
This is inside a new_usertype
but it isn't working. I also tried setting sol::function instead of sol::function&, it compiled but gave runtime error in lua_gettop() function.