Both parts of your last sentence are possible.
The GC will deal with previous instances of
BlaBla
, provided there are no references to them from elsewhere in your code,
Because it cannot be determined when GC will occur it is possible that there could be memory problems.
To help the GC, BlaBla should implement
IDisposable
and then
BlaBla MyInstance = null;
while(true)
{
if (MyInstance != null)
{
MyInstance.Dispose();
}
MyInstance = new BlaBla();
}
Here are links to a two part article on GC from MSDN Magazine
Part 1[
^]
Part 2[
^]