In c# I was wondering if there was any way to have a reference not allow what its referencing to migrate to the reference. Here's some FAKE c# code to illustrate what I mean:
class foo {}
class bar
{
public locked foo Foo; //of course locked doesn't actually exist
}
void main()
{
foo myFoo = new foo();
bar myBar == new bar();
myBar.Foo = myFoo;
myFoo = null
if (myBar.Foo == null)
{
println("foo = null");
}
}
//will print "foo = null"
obviously this won't compile, and when you delete foo it would just migrate to myBar.Foo, which I don;t want to happen