From 2e0f0b4f5e4066a34119d350395b085a1f691933 Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Sat, 17 Feb 2018 17:56:43 -0800 Subject: [PATCH] Do not cache the return value of ImGui.GetStyle. --- src/ImGui.NET/ImGui.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/ImGui.NET/ImGui.cs b/src/ImGui.NET/ImGui.cs index b2ee3c5..f7c6bbd 100644 --- a/src/ImGui.NET/ImGui.cs +++ b/src/ImGui.NET/ImGui.cs @@ -22,16 +22,9 @@ namespace ImGuiNET ImGuiNative.igShutdown(); } - private static unsafe readonly IO s_io = new IO(ImGuiNative.igGetIO()); + public static unsafe IO GetIO() => new IO(ImGuiNative.igGetIO()); - public static unsafe IO GetIO() => s_io; - - private static unsafe readonly Style s_style = new Style(ImGuiNative.igGetStyle()); - - public static unsafe Style GetStyle() - { - return s_style; - } + public static unsafe Style GetStyle() => new Style(ImGuiNative.igGetStyle()); public static void PushID(string id) {