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

Unnecessary argument passed to method called by Thread.start #18235

Closed
drtwisted opened this issue Apr 16, 2018 · 1 comment
Closed

Unnecessary argument passed to method called by Thread.start #18235

drtwisted opened this issue Apr 16, 2018 · 1 comment
Labels

Comments

@drtwisted
Copy link

Godot version: 3.X

OS/device including version: Linux (Probably macOS & Windows as well)

Issue description:

When starting a thread using my_thread.start(self, "_run_thread") construction without userdata argument provided _run_thread is still called with argument which is equal to null, I assume it's because of the defualt value declared in Thread.start definition.

Steps to reproduce:
Run the following code:

func _run_thread():
    print("I am a thread")

func _ready():
   var thread = Thread.new()
   thread.start(self, "_run_thread")

Expected result:
_run_thread gets called and we see the output of "I am a thread"

Actual result:
Thread is not run because of an error:

ERROR: _start_func: Could not call function '_run_thread'' starting thread ID: 5 Reason: Too Many Arguments
   At: core/bind/core_bind.cpp:2286.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants