Skip to content

Fix: Viewer leak when switching from multi to single selection#51

Merged
duartebarbosadev merged 3 commits intomainfrom
fix/viewer-leak-multi-to-single
Oct 8, 2025
Merged

Fix: Viewer leak when switching from multi to single selection#51
duartebarbosadev merged 3 commits intomainfrom
fix/viewer-leak-multi-to-single

Conversation

@duartebarbosadev
Copy link
Copy Markdown
Owner

  • Add _resize_viewer_pool method to dynamically manage viewer widgets
  • Update set_image_data, set_images_data, clear, and setText to use pool resizing
  • Add regression tests for viewer pool management
  • Prevent accumulation of hidden viewers after multi-selection

- Add _resize_viewer_pool method to dynamically manage viewer widgets
- Update set_image_data, set_images_data, clear, and setText to use pool resizing
- Add regression tests for viewer pool management
- Prevent accumulation of hidden viewers after multi-selection
Copilot AI review requested due to automatic review settings October 8, 2025 13:39
@duartebarbosadev duartebarbosadev changed the title Fix viewer leak when switching from multi to single selection Fix: Viewer leak when switching from multi to single selection Oct 8, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a memory leak issue in the SynchronizedImageViewer component where viewer widgets were accumulating when switching from multi-selection to single-selection mode.

  • Implements dynamic viewer pool management to prevent widget accumulation
  • Adds a _resize_viewer_pool method that automatically adjusts the number of viewer widgets
  • Includes comprehensive regression tests to ensure proper pool sizing behavior

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/ui/advanced_image_viewer.py Core implementation of viewer pool management with _resize_viewer_pool method
tests/test_advanced_image_viewer.py Regression tests for viewer pool shrinking and multi-selection size matching
src/ui/main_window.py Cleanup of deprecated handler method and comment removal
src/ui/app_controller.py Code formatting improvements and removal of deprecated signal handlers
src/ui/dark_theme.qss Removal of obsolete comments
src/core/image_processing/image_rotator.py Comment cleanup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Base automatically changed from refactor--async-rotation to main October 8, 2025 14:39
@duartebarbosadev duartebarbosadev merged commit eda21aa into main Oct 8, 2025
3 checks passed
@duartebarbosadev duartebarbosadev deleted the fix/viewer-leak-multi-to-single branch October 8, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants