Skip to content

fix: close SVG viewer and clear svg_data when score timeline is cleared#481

Draft
FelipeDefensor wants to merge 1 commit into
devfrom
fix/472-score-clear-svg-viewer
Draft

fix: close SVG viewer and clear svg_data when score timeline is cleared#481
FelipeDefensor wants to merge 1 commit into
devfrom
fix/472-score-clear-svg-viewer

Conversation

@FelipeDefensor

@FelipeDefensor FelipeDefensor commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Clears svg_data in the backend ScoreTLComponentManager.clear() so the svg_view property cannot recreate a viewer with stale SVG data after clearing.
  • Fixes reset_svg() to access the existing viewer directly via get() instead of going through the svg_view property (which auto-creates a viewer if none exists).

Test plan

  • Create a score timeline and import a MusicXML file — SVG viewer opens.
  • Clear the score timeline (Edit > Clear) — SVG viewer should close and not reappear.
  • Continue using the app — no crash when saving or performing other operations.

Closes #472

Clears svg_data in the backend so the viewer property does not
re-create the dock widget after deletion. Fixes reset_svg() to use
get() directly instead of the svg_view property to avoid creating a
new viewer if one doesn't exist.

Closes #472.
@FelipeDefensor FelipeDefensor force-pushed the fix/472-score-clear-svg-viewer branch from a554a0e to 3854f34 Compare May 6, 2026 15:55
@FelipeDefensor

Copy link
Copy Markdown
Collaborator Author

Add tests for this.

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.

1 participant