From 26e0e72b259311ba6ee19aca004bc98fc63c1cb5 Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Sun, 13 Nov 2022 04:57:10 +0800 Subject: [PATCH] Fixed lists not deserialising correctly --- SHADE_Managed/src/Serialisation/SerialisationUtilities.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SHADE_Managed/src/Serialisation/SerialisationUtilities.cxx b/SHADE_Managed/src/Serialisation/SerialisationUtilities.cxx index 20880947..147591a5 100644 --- a/SHADE_Managed/src/Serialisation/SerialisationUtilities.cxx +++ b/SHADE_Managed/src/Serialisation/SerialisationUtilities.cxx @@ -212,8 +212,10 @@ namespace SHADE System::Type^ listType = System::Collections::Generic::List::typeid->GetGenericTypeDefinition()->MakeGenericType(typeList); // Create a list of the specified type array^ params = gcnew array{ node.size() }; - object = System::Activator::CreateInstance(listType, params); - System::Collections::IList^ list = safe_cast(object); + System::Collections::IList^ list = safe_cast + ( + System::Activator::CreateInstance(listType, params) + ); // Populate the list for (int i = 0; i < LIST_SIZE; ++i) @@ -227,6 +229,7 @@ namespace SHADE list->Add(obj); } } + fieldInfo->SetValue(object, list); } }