1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

C#: Fix exported game crash because of uninitialized callbacks

This was a regression from 2c180f62d9,
where I forgot to update the source generator.
This commit is contained in:
Ignacio Roldán Etcheverry
2022-08-29 17:37:49 +02:00
parent c7e4c802ff
commit 8d9ff955b7

View File

@@ -27,7 +27,8 @@ namespace GodotPlugins.Game
internal static partial class Main internal static partial class Main
{ {
[UnmanagedCallersOnly(EntryPoint = ""godotsharp_game_main_init"")] [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 try
{ {
@@ -37,6 +38,8 @@ namespace GodotPlugins.Game
NativeLibrary.SetDllImportResolver(coreApiAssembly, dllImportResolver); NativeLibrary.SetDllImportResolver(coreApiAssembly, dllImportResolver);
NativeFuncs.Initialize(unmanagedCallbacks, unmanagedCallbacksSize);
ManagedCallbacks.Create(outManagedCallbacks); ManagedCallbacks.Create(outManagedCallbacks);
ScriptManagerBridge.LookupScriptsInAssembly(typeof(GodotPlugins.Game.Main).Assembly); ScriptManagerBridge.LookupScriptsInAssembly(typeof(GodotPlugins.Game.Main).Assembly);