I’m not quite sure if this is a memory leak or if the resources are not being released for GC, but it looks suspect since I’m referencing a property from another object.
I deserialize an XML file into an object. I then use this object to populate some properties of another object. Does doing this keep this deserialized-file-into-a-class-object in memory somewhere:
void Load() {
MyClass deserializedClass = Helper.GetDeserializedFileFromXml(path, type);
SetProperty(deserializedClass)
}
// MyProperty is a List<ADifferentClass>;
void SetProp(MyClass myClass) {
MyProperty = myClass.MyProperty;
}
UPDATE
I realized after reading the comments below that the crucial part (and why I asked this is) is that the property is a reference type, a List of a different class.
So, the answer was yes, because my property is referencing another classes (deserialized from XML) property that is a reference type. The deserialized class hangs around.