Fix: Viewer leak when switching from multi to single selection#51
Merged
duartebarbosadev merged 3 commits intomainfrom Oct 8, 2025
Merged
Fix: Viewer leak when switching from multi to single selection#51duartebarbosadev merged 3 commits intomainfrom
duartebarbosadev merged 3 commits intomainfrom
Conversation
Owner
duartebarbosadev
commented
Oct 8, 2025
- 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
Contributor
There was a problem hiding this comment.
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_poolmethod 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.