internal void DisposeUnused() { // TODO (Joex3): Wieder eigene Exception? if (!graphicsDevice.IsDisposed && !graphicsDevice.IsCurrent) { throw new InvalidOperationException("DisposeUnused must be called in the render thread, or after the GraphicsDevice has been disposed."); } if (DeferredDispose.Count > 0) { foreach (var obj in DeferredDispose) { // Das sollte eigentlich nie passieren. if (obj.IsDisposed) { Log.Debug("{0} is in DeferredDispose queue, but its already disposed.", obj.GetType().FullName); continue; } DotGame.Utils.Log.Warning("{0} is not disposed! {1}", obj.GetType().FullName, obj); obj.Dispose(); // TODO: (henrik1235) Überprüfen ob wir nicht obj.Dispose(bool isDisposing) aufrufen sollten, inbesondere weil dann die DeferredDispose Liste verändert werden kann } DeferredDispose.Clear(); } }
private void Dispose(bool isDisposing) { DisposeAll(); DeferredDispose.Clear(); }