Switching to AutoDispose

Instead of calling Dispose directly, call AutoDispose to dispose of the
reference based on the AllowAutoDispose property.

Still experimental.