Age | Commit message (Collapse) | Author |
|
https://github.com/GodotNativeTools/cpp_bindings/issues/26
|
|
In 3c53b35 a call to an "_init" function was introduced,
that however was only executed in the `_new` function,
also it *required* that such a function exists.
With this patch the "_init" function will be optionally called on
every instance creation.
|
|
In 3c53b35 a bug got introduced where a mutex gets locked twice
instead of locked and then unlocked.
This path fixes that.
|
|
This also adds basic locking for the set of owners
to avoid threading problems
|
|
Forward refcount changes to NativeScriptInstance
|
|
This also changes Reference::unreference() to always invoke
refcount_decremented. Previously it was not invoked until the count
reached zero due to short-circuit evalution of boolean expressions.
|
|
Godot may call property setters from non-main thread when an object is
loaded in the edtior. This means NativeScriptLanguage could be accessed
from different threads, but it was not designed for thread-safety.
Besides, previous behaviour made it so that godot_nativescript_init and
godot_gdnative_init could be invoked from non-main thread, while
godot_gdnative_thread is always invoked on the main thread. This may
not be expected by the binding library.
This commit defers native library initialization to the main thread and
adds godot_nativescript_thread_enter and godot_nativescript_thread_exit
callbacks to make a binding library aware of foreign threads.
|
|
|
|
|
|
|
|
|
|
|
|
This adds GDNative as a separate class type.
It can be used to interface with native libraries by
using "native calls", which can be registered by modules
(and in future other GDNative libraries?).
It also reworks the currently called "GDNativeScript" into a
"NativeScript" that just makes use of the new GDNative instead
of it being the component that implements that functionality.
|