diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/input/input.cpp | 4 | ||||
-rw-r--r-- | core/input/input.h | 1 | ||||
-rw-r--r-- | core/templates/oa_hash_map.h | 18 |
3 files changed, 16 insertions, 7 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp index 0db20a7c82..c0c029fda0 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -1446,4 +1446,8 @@ Input::Input() { } } +Input::~Input() { + singleton = nullptr; +} + ////////////////////////////////////////////////////////// diff --git a/core/input/input.h b/core/input/input.h index bbdac46805..42016f2417 100644 --- a/core/input/input.h +++ b/core/input/input.h @@ -331,6 +331,7 @@ public: void set_event_dispatch_function(EventDispatchFunc p_function); Input(); + ~Input(); }; VARIANT_ENUM_CAST(Input::MouseMode); diff --git a/core/templates/oa_hash_map.h b/core/templates/oa_hash_map.h index e4d9323c45..25c21d1802 100644 --- a/core/templates/oa_hash_map.h +++ b/core/templates/oa_hash_map.h @@ -246,13 +246,17 @@ public: return false; } - /** - * returns true if the value was found, false otherwise. - * - * if r_data is not nullptr then the value will be written to the object - * it points to. - */ - TValue *lookup_ptr(const TKey &p_key) const { + const TValue *lookup_ptr(const TKey &p_key) const { + uint32_t pos = 0; + bool exists = _lookup_pos(p_key, pos); + + if (exists) { + return &values[pos]; + } + return nullptr; + } + + TValue *lookup_ptr(const TKey &p_key) { uint32_t pos = 0; bool exists = _lookup_pos(p_key, pos); |