Here is how I explained it to a friend.
Type Balloon
Method New()
Print "A balloon was created"
End Method
Method Delete()
Print "The balloon flown away"
End Method
End Type
Print ""
Print "Creating the balloon and get a reference handle to it"
Local BalloonString1:Balloon = New Balloon
Print ""
Print "Creating a second reference handle that connects to whatever BalloonString1 are connected to."
Local BalloonString2:Balloon = BalloonString1
Print ""
Print "Releasing the first handle"
BalloonString1 = Null ' "Cut" the first string
Print "Flush away all nonreferenced objects"
FlushMem()
Print ""
Print "Releasing the second handle"
BalloonString2 = Null ' "Cut" the second string
Print "Flush away all nonreferenced objects"
FlushMem()
Print ""
Type Balloon
Method New()
Print "A balloon was created"
End Method
Method Delete()
Print "The balloon flown away"
End Method
End Type
Print ""
Print "Creating the balloon and get a reference handle to it"
Local BalloonString1:Balloon = New Balloon
Print ""
Print "Creating a second reference handle that connects to whatever BalloonString1 are connected to."
Local BalloonString2:Balloon = BalloonString1
Print ""
Print "Releasing the first handle"
BalloonString1 = Null ' "Cut" the first string
Print "Flush away all nonreferenced objects"
FlushMem()
Print ""
Print "Releasing the second handle"
BalloonString2 = Null ' "Cut" the second string
Print "Flush away all nonreferenced objects"
FlushMem()
Print ""