summaryrefslogtreecommitdiff
path: root/modules/mono/csharp_script.cpp
AgeCommit message (Collapse)Author
2020-01-24Merge pull request #35527 from neikeq/issue-35259Rémi Verschelde
Mono/C#: Fix _update_exports possible crash with Reference types
2020-01-24Mono/C#: Fix _update_exports possible crash with Reference typesIgnacio Etcheverry
The code was attempting to dynamic cast the native instance to Reference after the managed instance was disposed. As the managed instance acts as a Ref, the native instance was freed during that disposal. This made the dynamic cast fail and we attempted to memdelete a second time. The fix is to make the dynamic cast before disposal.
2020-01-23Mono/C#: Lighten up unsafe reference checksIgnacio Etcheverry
Because of the weird case with multi-threading and ResourceLoader, it can be the case that a resource is GCed while being referenced again in the main thread. In such cases, a new unsafe reference is created before the finalizer thread removes the previous one.
2020-01-19Fix ClassDB API portability with some android and editor classesIgnacio Etcheverry
- `EditorNavigationMeshGenerator` was being registered as part of the Core API, even after d3f48f88bb84d22b7805ce971ac86cf1953a29fd. We must make sure to set Editor as the current ClassDB API type before creating an instance. - The `VisualScriptEngineSingleton.constant` property has a property hint string that's different between tools and non-tools builds. This commit makes the hint string to no longer be set in `_bind_methods`, and to instead set it in `_validate_property`. This way it's ignored when calculating the API hash. - `JavaClassWrapper` is now registered in ClassDB on all platforms, using a dummy implementation on platforms other than Android. This fixes API portability between Android and other platforms. - Updated `--class-db-json` command to ignore non-virtual methods that start with an underscore (see: 4be87c6016a5893cbde897924e540df4c988cee5).
2020-01-16Merge pull request #35208 from neikeq/mono-lazy-thread-attachIgnacio Roldán Etcheverry
Mono/C#: Script interface calls now attach the current thread
2020-01-16Mono/C#: Script interface calls now attach the current threadIgnacio Etcheverry
Added guards to all C# script interface calls to attach the current thread for the current scope if the thread is not already attached. This is far from ideal, as attaching the thread is not cheap and all managed thread local storage is lost when we detach the thread at the end of the calls. However, it's the best we can do for now to avoid crashing when an unattached thread tries to interact with C# code.
2020-01-15Mono/C#: Fix false positive in unsafe reference checksIgnacio Etcheverry
2020-01-13Mono/C#: Add error checks to detect possible Reference leaksIgnacio Etcheverry
2020-01-13Mono/C#: Fix _update_exports() leaking temporary Object/Node instancesIgnacio Etcheverry
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-12-24Cleans up headers included in editor_node.hHaoyu Qiu
2019-11-29Mono/C#: Fix crash on exported games that don't use C#Ignacio Etcheverry
2019-11-15Mono/C#: Initial exporter support for AOT compilationIgnacio Etcheverry
2019-11-13Mono/C#: WebAssembly supportIgnacio Etcheverry
2019-09-25Added some obvious errors explanationsqarmin
2019-09-03Adds skip-breakpoints featureiwek7
2019-08-26Make VarArg methods return types show up as Variant in API jsontoasteater
VarArg methods have the return type Object in the API json for GDNative. This can cause undefined behavior in some language bindings due to lack of documentation on VarArg methods' behavior. This changes the MethodInfo of: - CSharpScript::_new - GDScript::_new - PluginScript::_new
2019-08-09Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'modules/mono'Ignacio Etcheverry
And 'CRASH_*_MSG' as well. Also make error messages puntuation and quotation more consistent.
2019-08-07Add some code changes/fixes proposed by Coverity and Clang Tidyqarmin
2019-07-24Mono: Add option to keep running after unhandled exceptionsIgnacio Etcheverry
By default, an unhandled exception will cause the application to be terminated; but the project setting `mono/unhandled_exception_policy` was added to change this behaviour. The editor is hard-coded to never terminate because of unhandled exceptions, as that would make writing editor plugins a painful task, and we cannot kill the editor because of a mistake in a thirdparty plugin.
2019-07-14Mono: Better handling of missing/outdated API assembliesIgnacio Etcheverry
Remove the old API assembly invalidation system. It's pretty simple since now the editor has a hard dependency on the API assemblies and SCons takes care of prebuilding them. If we fail to load a project's API assembly because it was either missing or outdated, we just copy the prebuilt assemblies to the project and try again. We also do this when creating the solution and before building, just in case the user removed them from the disk after they were loaded. This way the API assemblies will be always loaded successfully. If they are not, it's a bug. Also fixed: - EditorDef was behaving like GlobalDef in GodotTools. - NullReferenceException because we can't serialize System.WeakReference yet. Use Godot.WeakRef in the mean time.
2019-07-09Fix EditorNavigationMeshGenerator registered in Core APIIgnacio Etcheverry
Also added an option to output a json file with all the ClassDB registered classes and its members. This can be used to compare the API of two different builds by a simple diff.
2019-07-08Mono: Fix build errors with tools=noIgnacio Etcheverry
2019-07-08C#: Fix some crashes during assemblies reloadingIgnacio Etcheverry
2019-07-05Re-write mono module editor code in C#Ignacio Etcheverry
Make the build system automatically build the C# Api assemblies to be shipped with the editor. Make the editor, editor player and debug export templates use Api assemblies built with debug symbols. Always run MSBuild to build the editor tools and Api assemblies when building Godot. Several bugs fixed related to assembly hot reloading and restoring state. Fix StringExtensions internal calls not being registered correctly, resulting in MissingMethodException.
2019-07-03Mono: Android build and shared libraries fixesIgnacio Etcheverry
Fix location of Mono's shared libraries. Fix build failing if the directory 'platform/android/java/libs/{target}/{abi}' doesn't exist.
2019-07-01Remove unnecessary code and add some error explanationsqarmin
2019-06-26Some code changed with Clang-Tidyqarmin
2019-05-24C#: Implement ScriptInstance::to_stringIgnacio Etcheverry
Create a blacklist of methods that must not be generated. Includes: "to_string", "_to_string" and "_init".
2019-05-18C#: Marshalling support for IEnumerable<> and IDictionary<,>Ignacio Etcheverry
Also fixed the hint string of exported members.
2019-04-29C#: Support resource type hint in exported arraysIgnacio Etcheverry
- Elements of types like PackedScene will display with the special editor for such type.
2019-04-29Merge pull request #28423 from ↵Rémi Verschelde
neikeq/dont-forget-to-think-a-name-for-this-branch C#: Deprecate accessor methods and generate correct int and float types
2019-04-26Mono: Lazily load scripts metadata fileIgnacio Etcheverry
- Only load the scripts metadata file when it's really needed. This way we avoid false errors, when there is no C# project, about missing scripts metadata file.
2019-04-25C# bindings generator cleanupIgnacio Etcheverry
- Normal log messages are no longer warnings. - BindingsGenerator is no longer a singleton. - Added a log function.
2019-04-12Merge pull request #27950 from Nonnu42/contribIgnacio Roldán Etcheverry
Fixes #17233 allowing C# to override _GetPropertyList
2019-04-12Fixes #17233 allowing C# to override _GetPropertyListNuno Cardoso
2019-04-06C#: Support type hints for exported ArraysIgnacio Etcheverry
Added the code for Dictionary as well, but it's not yet supported by the Godot inspector.
2019-04-06C#: Add marshalling support for IEnumerable and IDictionaryIgnacio Etcheverry
Added constructor that takes IEnumerable for Array and IEnumerable<T> for Array<T>. Added constructor that takes IDictionary for Dictionary and IDictionary<TKey, TValue> for Dictionary<TKey, TValue>.
2019-04-04Mono: Make missing default constructor error more foolproofForLoveOfCats
2019-03-13C#: Update exports only in the editorIgnacio Etcheverry
2019-03-08Fix CSharpInstance::set not working with base classesIgnacio Etcheverry
2019-03-07Merge pull request #26773 from neikeq/issue-26628Rémi Verschelde
Mono: Fix crash with exported field of custom Reference derived type
2019-03-07Mono: Fix crash with exported field of custom Reference derived typeIgnacio Etcheverry
2019-03-07Mono: Partially implement some Godot debug api functionsIgnacio Etcheverry
Debug breaks sent with debug_break and debug_break_parse should display correctly in the Godot debugger now.
2019-03-07Merge pull request #26765 from neikeq/issue-25959Ignacio Etcheverry
Mono: Fix crash when re-using script binding after domain reloading
2019-03-07Mono: Fix crash when re-using script binding after domain reloadingIgnacio Etcheverry
2019-03-07Update scripts exports even when normal script instances are created to ↵Sebastian Hartte
better support tool scripts with exported variables.
2019-02-28Mono: Fail on script instance creation if constructor was not foundIgnacio Etcheverry
Previously this would result in NULL dereferencing. Now we fail with an error.
2019-02-27Fix -Wsign-compare warnings.marxin
I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type.
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.