Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复与继承相关的绑定导致的崩溃和无限循环问题 #719

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BaconVN
Copy link

@BaconVN BaconVN commented Aug 8, 2024

我有 BP_Child 和 BP_Base,它们分别绑定到 Child.lua 和 Base.lua。Child.lua 和 Base.lua 都重写了 FunctionA()。当我在 BP_Child 中调用 FunctionA() 时,它导致了无限循环错误。根本原因是,当执行到 BP_Base 中的 FunctionA 时,由于 Base.lua 重写了 FunctionA(),UnLua 决定再次触发 FunctionA(),这就导致了一个无限循环。你可以看下面的图表来直观理解。

image
我在调用 LuaFunction 时添加了检查,判断调用的 ULuaFunction 是否来自父类,且与对象的 UClass 不是同一个类。这就是为什么我们跳过调用 Lua 端,而是调用被重写的函数,以防止继承相关的 bug。

@tencent-adm
Copy link
Member

tencent-adm commented Aug 8, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants