I'm not speaking about unmanaged code or external libraries.
I ment something like the following:
If you have an Orders Form which hold a collection of Order Entities (_orders).
And you have a global variable: Customer Entity (Customer).
If you set link them together as follows:
foreach(var order in _orders)
{
order.Customer = Customer;
}
Then if you close or dispose the Orders Form, the Order Entities will remain in memory because they are referenced by another Entity which lives outside the boundary of the Form. And this will remain the case unless you dispose the Customer entity.