Fix crash when setting C# property of value-type from native code

This commit is contained in:
Wojtek Figat
2025-02-21 20:22:54 +01:00
parent b81b0b7616
commit bb12562c2f
2 changed files with 5 additions and 5 deletions

View File

@@ -1531,7 +1531,7 @@ bool ManagedBinaryModule::SetFieldValue(void* field, const Variant& instance, Va
if ((uintptr)field & ManagedBinaryModuleFieldIsPropertyBit)
{
const auto mProperty = (MProperty*)((uintptr)field & ~ManagedBinaryModuleFieldIsPropertyBit);
mProperty->SetValue(instanceObject, MUtils::BoxVariant(value), nullptr);
mProperty->SetValue(instanceObject, MUtils::VariantToManagedArgPtr(value, mProperty->GetType(), failed), nullptr);
}
else
{