Circular reference and Garbage collection

G

Guogang

Hi, I have a tree structure in C# with pointer to children and parent. This
will form a circular reference.

My question: will this kind of circular reference affect garbage collection
(parent has references to children, and children have references to parent.
such that none of them can be GC)?

If yes, how can I avoid it?

Thanks,
Guogang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top