/// <summary> /// releases all C# - references on an object, making it ready for garbage-collection. /// </summary> public static void ReleaseObject(ref int _ref, out int ierr) { ierr = 0; try { object o = Infrastructure.GetObject(_ref); if (o is IDisposable) { ((IDisposable)o).Dispose(); } Infrastructure.ForgetObject(_ref); } catch (Exception e) { ierr = Infrastructure.ErrorHandler(e); } }