From 47a31fbe4565b56407f2c9284f96623ed373fb86 Mon Sep 17 00:00:00 2001 From: Rob Bertels Date: Sun, 22 Sep 2024 09:51:31 +0200 Subject: [PATCH] Dispose of MouseState at end of UpdateImGuiInput --- .../Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs b/src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs index ad1125287b..6eafd99393 100644 --- a/src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs +++ b/src/OpenGL/Extensions/Silk.NET.OpenGL.Extensions.ImGui/ImGuiController.cs @@ -251,7 +251,7 @@ private void UpdateImGuiInput() { var io = ImGuiNET.ImGui.GetIO(); - var mouseState = _input.Mice[0].CaptureState(); + using var mouseState = _input.Mice[0].CaptureState(); io.MouseDown[0] = mouseState.IsButtonPressed(MouseButton.Left); io.MouseDown[1] = mouseState.IsButtonPressed(MouseButton.Right);