You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto object = UD->delegate->GetUObject();
if (object)
{
ULuaDelegate* delegateObj = Cast<ULuaDelegate>(object);
if (delegateObj)
{
delegateObj->dispose();
LuaObject::removeRef(L, object);
}
}
// bind luafucntion and signature function
auto obj = NewObject<ULuaDelegate>((UObject*)GetTransientPackage(), ULuaDelegate::StaticClass());
在Lua中连续调用多次BInd一个代理,断点发现ULuaDelegate的析构函数只有Clear的时候会析构最后一次绑定的ULuaDelegate对象,其他对象未被回收,需要等到程序结束后,才会断点到ULuaDelegate的析构函数,建议在Bind的时候,先检查上次的绑定对象是否是ULuaDelegate对象,如果是将它释放``int LuaDelegate::Bind(lua_State* L)
{
CheckUD(LuaDelegateWrap, L, 1);
#if WITH_EDITOR
obj->setPropName(UD->pName);
#endif
obj->bindFunction(L, 2, UD->ufunc);
The text was updated successfully, but these errors were encountered: