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
I'm using Thread.start() to load static data for my game, like so:
var _thread = Thread.new()
func start_loading():
_thread.start(self, "_load_my_data")
func _load_my_data(_unused_but_mandatory_thread_arg):
# here I'm loading my data
pass
This was working perfectly at least since 3.2, including 3.3.stable, however with 3.4.beta3 I get this error:
E 0:00:00.724 _start_func: Could not call function '_load_my_data' to start thread -8534501772636260605: Too Few Arguments.
<C++ Error> Method failed.
<C++ Source> core/bind/core_bind.cpp:2673 @ _start_func()
If I modify my code by specifying the 3rd argument for the Thread.start, the error doesn't show and my code completes as expected:
_thread.start(self, "_load_my_data", 1)
Passing null (instead of 1) also invokes the error, so I'm guessing Thread.start's userdata argument no longer has a default null value, and/or no longer accepts a null value.
Steps to reproduce
Try to start a thread by only passing the first 2 mandatory arguments to Thread.start(). You'll find that now you also must pass a non-null 3rd argument.
This should hav been fixed by #51093 + #51385 + their cherry-picks to 3.x. I don't know which of them made to the beta. Furthermore, I'm failing to find the cherry-pick of the latter in the 3.x branch.
Godot version
3.4.beta3
System information
Windows 10
Issue description
I'm using Thread.start() to load static data for my game, like so:
This was working perfectly at least since 3.2, including 3.3.stable, however with 3.4.beta3 I get this error:
If I modify my code by specifying the 3rd argument for the Thread.start, the error doesn't show and my code completes as expected:
Passing
null
(instead of1
) also invokes the error, so I'm guessing Thread.start'suserdata
argument no longer has a defaultnull
value, and/or no longer accepts a null value.Steps to reproduce
Try to start a thread by only passing the first 2 mandatory arguments to Thread.start(). You'll find that now you also must pass a non-null 3rd argument.
Minimal reproduction project
Thread_start_3rd_arg_bug_demo.zip
The text was updated successfully, but these errors were encountered: