diff --git a/aurora/lib/aurora.cpp b/aurora/lib/aurora.cpp index e83007f25..b54f60c6f 100644 --- a/aurora/lib/aurora.cpp +++ b/aurora/lib/aurora.cpp @@ -215,8 +215,6 @@ static bool poll_events() noexcept { break; } case SDL_QUIT: - g_AppDelegate->onAppExiting(); - Log.report(logvisor::Info, FMT_STRING("Received quit request")); return false; } // Log.report(logvisor::Info, FMT_STRING("Received SDL event: {}"), event.type); @@ -350,6 +348,7 @@ void app_run(std::unique_ptr app, Icon icon, int argc, char** argv) ImGui::EndFrame(); } + Log.report(logvisor::Info, FMT_STRING("Application exiting")); g_AppDelegate->onAppExiting(); imgui::shutdown(); diff --git a/aurora/lib/input.cpp b/aurora/lib/input.cpp index 267cc7296..a55b4d909 100644 --- a/aurora/lib/input.cpp +++ b/aurora/lib/input.cpp @@ -56,7 +56,6 @@ static std::optional remap_controller_layout(std::string_view mappi newMapping.push_back(':'); newMapping.append(v); } - Log.report(logvisor::Info, FMT_STRING("New mapping: {}"), newMapping); return newMapping; } @@ -64,9 +63,10 @@ Sint32 add_controller(Sint32 which) noexcept { auto* ctrl = SDL_GameControllerOpen(which); if (ctrl != nullptr) { { - const char* mapping = SDL_GameControllerMapping(ctrl); + char* mapping = SDL_GameControllerMapping(ctrl); if (mapping != nullptr) { auto newMapping = remap_controller_layout(mapping); + SDL_free(mapping); if (newMapping) { if (SDL_GameControllerAddMapping(newMapping->c_str()) == -1) { Log.report(logvisor::Error, FMT_STRING("Failed to update controller mapping: {}"), SDL_GetError());