diff --git a/seika/input/input.c b/seika/input/input.c index 963b496..ef4081a 100644 --- a/seika/input/input.c +++ b/seika/input/input.c @@ -23,6 +23,7 @@ void input_load_gamepads(); void input_process_gamepad(SDL_Event event); void input_initialize_gamepad_system(); +void input_finalize_gamepad_system(); void input_gamepad_cleanup_flags(); //--- Input ---// @@ -173,7 +174,12 @@ bool se_input_initialize() { return true; } -void se_input_finalize() {} +void se_input_finalize() { + se_string_hash_map_destroy(inputActionMap); + se_string_hash_map_destroy(keyboardStringValuesMap); + input_finalize_gamepad_system(); + se_mouse_clear(); +} void se_input_add_action_value(const char* actionName, const char* actionValue, int deviceId) { if (!se_string_hash_map_has(inputActionMap, actionName)) { @@ -441,6 +447,10 @@ void input_initialize_gamepad_system() { input_load_gamepads(); } +void input_finalize_gamepad_system() { + se_string_hash_map_destroy(gamepadStringValuesMap); +} + void input_load_gamepads() { for (size_t i = 0; i < CRE_MAX_GAMEPAD_DEVICES; i++) { activeGamePads[i].gameController = NULL;