public static void ExecuteProgram(ITrain train) { RemoteControl remoteControl = new RemoteControl(); train.Control = remoteControl; train.Start(); train.Stop(); //train.Control = null; // memory leak }