+5 votes

So, I have a thread which runs youtube-dl and uses it to search for a song and download it.

So, I have this problem where if the user types a query, I need to kill the existing thread and then start the new one.

This the code I use to run my thread function.

search_thread = Thread.new()
var search_err = search_thread.start(self, "print_search", [$UISearch/LineEdit.text])

Now I some how need to know if one instance of search_thread(search_err?) is running and if it is kill it and start a new one.

in Engine by (49 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.