/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing">true if the object is being disposed; false if the object is being finalized.</param> protected override void Dispose(Boolean disposing) { if (Disposed) { return; } if (disposing) { var glname = program; if (glname != 0 && !Ultraviolet.Disposed) { Ultraviolet.QueueWorkItem((state) => { gl.DeleteProgram(glname); gl.ThrowIfError(); }, this, WorkItemOptions.ReturnNullOnSynchronousExecution); } if (programOwnsShaders) { SafeDispose.Dispose(vertexShader); SafeDispose.Dispose(fragmentShader); } program = 0; } base.Dispose(disposing); }
/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing">true if the object is being disposed; false if the object is being finalized.</param> protected override void Dispose(Boolean disposing) { if (Disposed) { return; } if (disposing) { if (!Ultraviolet.Disposed) { ((OpenGLUltravioletGraphics)Ultraviolet.GetGraphics()).UnbindTexture(this); } if (willNotBeSampled) { if (!Ultraviolet.Disposed && renderbuffer != 0) { Ultraviolet.QueueWorkItem((state) => { gl.DeleteRenderBuffers(((OpenGLRenderBuffer2D)state).renderbuffer); gl.ThrowIfError(); }, this); } } else { SafeDispose.Dispose(texture); } } base.Dispose(disposing); }
/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing">true if the object is being disposed; false if the object is being finalized.</param> protected override void Dispose(Boolean disposing) { if (Disposed) { return; } if (samplerObjects != null) { for (int i = 0; i < samplerObjects.Length; i++) { SafeDispose.Dispose(samplerObjects[i]); } } if (gl.Initialized) { gl.Uninitialize(); } SDL_GL_DeleteContext(context); context = IntPtr.Zero; base.Dispose(disposing); }
/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing">true if the object is being disposed; false if the object is being finalized.</param> protected override void Dispose(Boolean disposing) { if (Disposed) { return; } if (disposing) { if (!Ultraviolet.Disposed) { Ultraviolet.QueueWorkItem((state) => { gl.DeleteProgram(((OpenGLShaderProgram)state).program); gl.ThrowIfError(); }, this); } if (programOwnsShaders) { SafeDispose.Dispose(vertexShader); SafeDispose.Dispose(fragmentShader); } } base.Dispose(disposing); }
/// <summary> /// Invalidates the cached state objects. /// </summary> private static void InvalidateCache() { SafeDispose.DisposeRef(ref cachedOpaque); SafeDispose.DisposeRef(ref cachedAlphaBlend); SafeDispose.DisposeRef(ref cachedAdditive); SafeDispose.DisposeRef(ref cachedNonPremultiplied); }
/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing"><see langword="true"/> if the object is being disposed; /// <see langword="false"/> if the object is being finalized.</param> protected virtual void Dispose(Boolean disposing) { if (Disposed) { return; } if (disposing) { SafeDispose.Dispose(GetUI()); SafeDispose.Dispose(GetInput()); SafeDispose.Dispose(GetContent()); SafeDispose.Dispose(GetPlatform()); SafeDispose.Dispose(GetGraphics()); SafeDispose.Dispose(GetAudio()); } WaitForPendingTasks(true); this.Disposing = true; ProcessWorkItems(); OnShutdown(); ChangeSynchronizationContext(null); this.Disposed = true; this.Disposing = false; ReleaseContext(); }
/// <summary> /// Releases resources associated with this object. /// </summary> /// <param name="disposing"><see langword="true"/> if the object is being disposed; <see langword="false"/> if the object is being finalized.</param> protected override void Dispose(Boolean disposing) { if (disposing && !Disposed) { SafeDispose.Dispose(screenStacks); } base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.DisposeRef(ref instanceManager); } base.Dispose(disposing); }
public void SetsReferenceToNull() { IDisposable myDisposable = DisposableFactory.CreateDisposable(); SafeDispose.DisposeAndSetNull(ref myDisposable); Assert.Equal(null, myDisposable); }
/// <inheritdoc/> protected override void CleanupOverride() { SafeDispose.DisposeRef(ref geometryStream); SafeDispose.DisposeRef(ref vbuffer); SafeDispose.DisposeRef(ref effect); base.CleanupOverride(); }
/// <summary> /// Releases resources associated with this object. /// </summary> /// <param name="disposing"><see langword="true"/> if the object is being disposed; <see langword="false"/> if the object is being finalized.</param> private void Dispose(Boolean disposing) { if (disposing && !disposed) { SafeDispose.Dispose(spriteBatch); } disposed = true; }
/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing"><see langword="true"/> if the object is being disposed; <see langword="false"/> if the object is being finalized.</param> protected virtual void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(txtWriter); SafeDispose.Dispose(strWriter); } }
/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing"><see langword="true"/> if the object is being disposed; <see langword="false"/> if the object is being finalized.</param> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(texture); } base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(escMenuDialog); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (disposing) { SafeDispose.DisposeRef(ref _content); } base.Dispose(disposing); }
/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing">true if the object is being disposed; false if the object is being finalized.</param> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.DisposeRef(ref content); } base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(screen); } base.Dispose(disposing); }
/// <summary> /// Invalidates the cached state objects. /// </summary> private static void InvalidateCache() { SafeDispose.DisposeRef(ref cachedPointClamp); SafeDispose.DisposeRef(ref cachedPointWrap); SafeDispose.DisposeRef(ref cachedLinearClamp); SafeDispose.DisposeRef(ref cachedLinearWrap); SafeDispose.DisposeRef(ref cachedAnisotropicClamp); SafeDispose.DisposeRef(ref cachedAnisotropicWrap); }
protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(spriteBatch); SafeDispose.Dispose(content); } base.Dispose(disposing); }
protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(songPlayer); SafeDispose.Dispose(contentManager); } base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(compositor); } SDL.DestroyWindow(ptr); base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing && !Ultraviolet.Disposed) { SafeDispose.DisposeRef(ref pool); } base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(this.view); SafeDispose.Dispose(this.localContent); } base.Dispose(disposing); }
/// <summary> /// Releases resources associated with the object. /// </summary> /// <param name="disposing">true if the object is being disposed; false if the object is being finalized.</param> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.DisposeRef(ref screenService); SafeDispose.DisposeRef(ref globalStyleSheet); SafeDispose.DisposeRef(ref content); } base.Dispose(disposing); }
public void DisposeCalled() { bool disposeCalled = false; IDisposable myDisposable = DisposableFactory.CreateDisposable( () => disposeCalled = true); SafeDispose.DisposeAndSetNull(ref myDisposable); Assert.True(disposeCalled); }
/// <inheritdoc/> protected sealed override void OnUltravioletRun() { Run(); SafeDispose.DisposeRef(ref uv); if (finished) { Finish(); } }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(spriteBatch); SafeDispose.Dispose(renderTargetPool); registeredElements.Clear(); } base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing) { SafeDispose.Dispose(renderTarget); SafeDispose.Dispose(colorBuffer); SafeDispose.Dispose(depthBuffer); SafeDispose.Dispose(stencilBuffer); } base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing && !Ultraviolet.Disposed) { Ultraviolet.GetUI().Updating -= StoryboardClockPool_Updating; SafeDispose.DisposeRef(ref pool); } base.Dispose(disposing); }
/// <inheritdoc/> protected override void Dispose(Boolean disposing) { if (disposing) { foreach (var device in devices) { SafeDispose.Dispose(device); } } base.Dispose(disposing); }