Improve stability by fixing various crashes with dotnet7

This commit is contained in:
Wojtek Figat
2023-04-18 12:36:33 +02:00
parent 024dd74ae1
commit f046642ba7
8 changed files with 37 additions and 38 deletions

View File

@@ -223,7 +223,7 @@ void ScriptingObject::SetManagedInstance(MObject* instance)
#if USE_NETCORE
_gcHandle = (MGCHandle)instance;
#elif !COMPILE_WITHOUT_CSHARP
_gcHandle = MCore::GCHandle::New(instance, false);
_gcHandle = MCore::GCHandle::New(instance);
#endif
}
@@ -433,7 +433,7 @@ void ManagedScriptingObject::SetManagedInstance(MObject* instance)
#if USE_NETCORE
_gcHandle = (MGCHandle)instance;
#elif !COMPILE_WITHOUT_CSHARP
_gcHandle = MCore::GCHandle::NewWeak(instance, false);
_gcHandle = MCore::GCHandle::NewWeak(instance);
#endif
}