Improve stability by fixing various crashes with dotnet7
This commit is contained in:
@@ -93,8 +93,8 @@ public:
|
||||
/// </summary>
|
||||
struct FLAXENGINE_API GCHandle
|
||||
{
|
||||
static MGCHandle New(MObject* obj, bool pinned);
|
||||
static MGCHandle NewWeak(MObject* obj, bool trackResurrection);
|
||||
static MGCHandle New(MObject* obj, bool pinned = false);
|
||||
static MGCHandle NewWeak(MObject* obj, bool trackResurrection = false);
|
||||
static MObject* GetTarget(const MGCHandle& handle);
|
||||
static void Free(const MGCHandle& handle);
|
||||
};
|
||||
|
||||
@@ -995,7 +995,7 @@ MClass* MUtils::GetClass(const Variant& value)
|
||||
return stdTypes.MatrixClass;
|
||||
case VariantType::Array:
|
||||
case VariantType::Dictionary:
|
||||
return GetClass(value.Type);
|
||||
break;
|
||||
case VariantType::Object:
|
||||
return value.AsObject ? value.AsObject->GetClass() : nullptr;
|
||||
case VariantType::Asset:
|
||||
@@ -1004,10 +1004,14 @@ MClass* MUtils::GetClass(const Variant& value)
|
||||
case VariantType::Enum:
|
||||
return Scripting::FindClass(StringAnsiView(value.Type.TypeName));
|
||||
case VariantType::ManagedObject:
|
||||
return MCore::Object::GetClass((MObject*)value);
|
||||
{
|
||||
MObject* obj = (MObject*)value;
|
||||
if (obj)
|
||||
return MCore::Object::GetClass(obj);
|
||||
}
|
||||
default: ;
|
||||
}
|
||||
return nullptr;
|
||||
return GetClass(value.Type);
|
||||
}
|
||||
|
||||
MTypeObject* MUtils::GetType(MObject* object)
|
||||
|
||||
Reference in New Issue
Block a user