diff options
author | Ariel Manzur <punto@godotengine.org> | 2015-12-18 03:06:51 -0300 |
---|---|---|
committer | Ariel Manzur <punto@godotengine.org> | 2015-12-18 03:06:51 -0300 |
commit | f25812794d7c18aee35d7e4faff70890a95cd4db (patch) | |
tree | 930161df2f791a16364a4e098ac51d6e828ee606 | |
parent | 4a7e5fafb12f620ce6ed763940db11338144308d (diff) |
thread renaming by core_bind
-rw-r--r-- | core/bind/core_bind.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 743ae19a93..a5f778deb4 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1883,6 +1883,13 @@ void _Thread::_start_func(void *ud) { Variant::CallError ce; const Variant* arg[1]={&t->userdata}; + if (t->name == "") { + // come up with a better name using maybe the filename on the Script? + t->thread->set_name(t->target_method); + } else { + t->thread->set_name(t->name); + }; + t->ret=t->target_instance->call(t->target_method,arg,1,ce); if (ce.error!=Variant::CallError::CALL_OK) { @@ -1941,9 +1948,6 @@ Error _Thread::start(Object *p_instance,const StringName& p_method,const Variant return ERR_CANT_CREATE; } - if (name != "") - thread->set_name(name); - return OK; } |