-
Notifications
You must be signed in to change notification settings - Fork 586
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
关闭RPC会导致部分函数在非Editor模式下crash #293
Comments
如果参数是const的话,是无法作为Out参数的,可以在蓝图中添加一个Test调用做对比。如果带const的会出现在节点左侧,不带的才能出现在右侧。 当使用const参数时,蓝图中是必须传入的,否则无法通过编译。而lua中没有对这个做限制,导致不传参数的话就会变成为未初始化的一块内存,这个时候如果在C++侧访问就会出现无法预期的情况,甚至Crash。我看看这能不能做下限制。 |
xuyanghuang-tencent
added a commit
that referenced
this issue
Nov 20, 2021
这里有两个问题。 UFUNCTION(BlueprintCallable, meta = (AutoCreateRefTerm = "Event, Array"))
static int32 Test(const FString& A, int32 B, const FOnTestEvent& Event, const TArray<FSlateColor>& Array); 在蓝图下,后两个参数不传也可以通过。现在这个类型检测是认不出来“AutoCreateRefTerm”的。 UE4.UTestLibrary.Test("a", 1, {world, function () end}, TArray(UE4.FSlateColor)) array的内存地址依然是错的 |
xuyanghuang-tencent
added a commit
that referenced
this issue
Nov 22, 2021
xuyanghuang-tencent
added a commit
that referenced
this issue
Nov 23, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FunctionDesc.cpp中如下代码
如果关闭RPC,会在非Editor模式下走上面的if语句。会触发带out参数的函数的crash。
测试用例如下:
在lua中调用UE4.UTestLibrary.Test(1),会走到if语句中,此时Array已经错误。
The text was updated successfully, but these errors were encountered: