diff options
author | Ignacio Roldán Etcheverry <ignalfonsore@gmail.com> | 2022-08-29 17:37:49 +0200 |
---|---|---|
committer | Ignacio Roldán Etcheverry <ignalfonsore@gmail.com> | 2022-08-29 17:37:56 +0200 |
commit | 8d9ff955b7a354951cba98a4f37a4f4a73a2775f (patch) | |
tree | 40f38c1652fdbec0e51c46642cb89158411d46b0 /modules/mono/editor | |
parent | c7e4c802ffcea465f995c4f203ace1278f41286c (diff) |
C#: Fix exported game crash because of uninitialized callbacks
This was a regression from 2c180f62d985194060f1a8d2070c130081177c90,
where I forgot to update the source generator.
Diffstat (limited to 'modules/mono/editor')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotPluginsInitializerGenerator.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotPluginsInitializerGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotPluginsInitializerGenerator.cs index 54da6218f3..7ec3f88e5d 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotPluginsInitializerGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotPluginsInitializerGenerator.cs @@ -27,7 +27,8 @@ namespace GodotPlugins.Game internal static partial class Main { [UnmanagedCallersOnly(EntryPoint = ""godotsharp_game_main_init"")] - private static godot_bool InitializeFromGameProject(IntPtr godotDllHandle, IntPtr outManagedCallbacks) + private static godot_bool InitializeFromGameProject(IntPtr godotDllHandle, IntPtr outManagedCallbacks, + IntPtr unmanagedCallbacks, int unmanagedCallbacksSize) { try { @@ -37,6 +38,8 @@ namespace GodotPlugins.Game NativeLibrary.SetDllImportResolver(coreApiAssembly, dllImportResolver); + NativeFuncs.Initialize(unmanagedCallbacks, unmanagedCallbacksSize); + ManagedCallbacks.Create(outManagedCallbacks); ScriptManagerBridge.LookupScriptsInAssembly(typeof(GodotPlugins.Game.Main).Assembly); |