Fix InputMap and display server not nulling singleton on free

This commit is contained in:
Paulb23 2021-07-11 14:26:18 +01:00
parent 55a20129d6
commit d186862338
3 changed files with 6 additions and 0 deletions

View File

@ -746,3 +746,7 @@ InputMap::InputMap() {
ERR_FAIL_COND_MSG(singleton, "Singleton in InputMap already exist.");
singleton = this;
}
InputMap::~InputMap() {
singleton = nullptr;
}

View File

@ -95,6 +95,7 @@ public:
const OrderedHashMap<String, List<Ref<InputEvent>>> &get_builtins();
InputMap();
~InputMap();
};
#endif // INPUT_MAP_H

View File

@ -605,4 +605,5 @@ DisplayServer::DisplayServer() {
}
DisplayServer::~DisplayServer() {
singleton = nullptr;
}