Skip to content

Commit

Permalink
imgui: free cursors for all backends
Browse files Browse the repository at this point in the history
  • Loading branch information
scribam committed Sep 4, 2024
1 parent 84e3f11 commit eaa8705
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions vita3k/gui/src/imgui_impl_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ IMGUI_API void ImGui_ImplSdl_Shutdown(ImGui_State *state) {
default:
LOG_ERROR("Missing ImGui init for backend {}.", static_cast<int>(state->renderer->current_backend));
}

for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)
SDL_FreeCursor(state->mouse_cursors[cursor_n]);
}
IMGUI_API void ImGui_ImplSdl_NewFrame(ImGui_State *state) {
ImGuiIO &io = ImGui::GetIO();
Expand Down
5 changes: 0 additions & 5 deletions vita3k/gui/src/imgui_impl_sdl_gl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,6 @@ IMGUI_API ImGui_GLState *ImGui_ImplSdlGL3_Init(renderer::State *renderer, SDL_Wi
}

void ImGui_ImplSdlGL3_Shutdown(ImGui_GLState &state) {
// Destroy SDL mouse cursors
for (auto &mouse_cursor : state.mouse_cursors)
SDL_FreeCursor(mouse_cursor);
memset(state.mouse_cursors, 0, sizeof(state.mouse_cursors));

// Destroy OpenGL objects
ImGui_ImplSdlGL3_InvalidateDeviceObjects(state);
}
Expand Down

0 comments on commit eaa8705

Please sign in to comment.