/// <summary> /// Free all resources acquired by the overlay. /// </summary> public virtual void Dispose() { if (renderThread.IsAlive) { Close(); } graphicsDevice.WaitForIdle(); imController.Dispose(); commandList.Dispose(); graphicsDevice.WaitForIdle(); graphicsDevice.Dispose(); loadedImages.Clear(); }
/// <summary> /// Free all resources acquired by the overlay /// </summary> public void Dispose() { window.Close(); while (!isClosed) { Thread.Sleep(10); } uiThread.Join(); graphicsDevice.WaitForIdle(); imController.Dispose(); commandList.Dispose(); graphicsDevice.Dispose(); hookController.Dispose(); NativeMethods.ShowConsoleWindow(); this.SubmitUI = null; Console.WriteLine("All Overlay resources are cleared."); Application.Exit(); }