"Reference Leak Alternative Fix for SetData Method"

class ExampleClass {
	readonly List<SomeDataType> someData = new List<SomeDataType>();

	public void SetData(List<SomeDataType> newData) {
		lock (dataLock) {
			someData.Clear();
			AddData(newData);
		}
	}
}


Code snippet taken from "Common Multithreading Mistakes in C# - IV: Everything Else".