Answer the question
In order to leave comments, you need to log in
Do I need to implement the "Mark and Sweep" mechanism myself, or is it already in the garbage collector?
Let's say we have code:
class Program
{
public static void Main()
{
Element el1 = new Element();
Element el2 = new Element(){OtherElement = el1};
el1.OtherElement = el2;
}
}
class Element
{
public Element OtherElement {get; set;}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question