From d18686233868d81b0c22d554714c4171cf83a509 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sun, 11 Jul 2021 14:26:18 +0100 Subject: Fix InputMap and display server not nulling singleton on free --- core/input/input_map.cpp | 4 ++++ core/input/input_map.h | 1 + 2 files changed, 5 insertions(+) (limited to 'core/input') diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index c7ca65f61a..ebab1d12fd 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -746,3 +746,7 @@ InputMap::InputMap() { ERR_FAIL_COND_MSG(singleton, "Singleton in InputMap already exist."); singleton = this; } + +InputMap::~InputMap() { + singleton = nullptr; +} diff --git a/core/input/input_map.h b/core/input/input_map.h index a2d3952f94..c724fdb142 100644 --- a/core/input/input_map.h +++ b/core/input/input_map.h @@ -95,6 +95,7 @@ public: const OrderedHashMap>> &get_builtins(); InputMap(); + ~InputMap(); }; #endif // INPUT_MAP_H -- cgit v1.2.3