public void delete() { foreach (TTNode child in children) { child.delete(); } tb.Dispose(); cb.Dispose(); linesToChildren.Clear(); if (lineToParent != null) { lineToParent.Dispose(); lineToParent = null; } if (parent != null) { parent.linesToChildren.Clear(); } if (sibling != null && !siblingDeleted) { siblingDeleted = true; sibling.delete(); } }