Fixed CollectBasicObject test by lostmsu · Pull Request #1313 · pythonnet/pythonnet

This contains two fixes, that must go along for the tests to pass:

  1. Fixed the CollectBasicObject and CollectOnShutdown tests for Mono by fixing MakeAGarbage function to not keep the garbage on the stack during a conservative roots scan (looks like Mono scans some variables, that are already gone).
  2. Fixed the crash during runtime shutdown by further simplifying Finalizer to only store raw pointers to python objects instead of instances of IPyDisposable and thus replacing Dispose with reliable and simple DecRef.

This removes some functions from Finalizer, which previously were public, but should not have been.