Various fixes to scripting

This commit is contained in:
Wojtek Figat
2023-03-06 16:17:52 +01:00
parent 31411e334b
commit aaaf7c5c37
8 changed files with 73 additions and 87 deletions

View File

@@ -221,12 +221,12 @@ void ScriptingObject::ChangeID(const Guid& newId)
_type.GetType().Module->OnObjectIdChanged(this, prevId);
}
void ScriptingObject::SetManagedInstance(MonoObject* instance)
void ScriptingObject::SetManagedInstance(MObject* instance)
{
ASSERT(_gcHandle == 0);
#if USE_NETCORE
_gcHandle = (MGCHandle)instance;
#else
#elif !COMPILE_WITHOUT_CSHARP
_gcHandle = MUtils::NewGCHandle(instance, false);
#endif
}
@@ -454,12 +454,12 @@ ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params)
{
}
void ManagedScriptingObject::SetManagedInstance(MonoObject* instance)
void ManagedScriptingObject::SetManagedInstance(MObject* instance)
{
ASSERT(_gcHandle == 0);
#if USE_NETCORE
_gcHandle = (MGCHandle)instance;
#else
#elif !COMPILE_WITHOUT_CSHARP
_gcHandle = MUtils::NewGCHandleWeakref(instance, false);
#endif
}