Fix stale queue after closing macOS player window with Cmd+W

Closing the separate player window via Cmd+W (or the traffic-light
button) stopped the player but left the queue populated, so the next
video tap showed the Play Now/Play Next/Add to Queue prompt. Clear the
queue in windowShouldClose to match the close button behavior.
This commit is contained in:
Arkadiusz Fal
2026-06-04 18:27:29 +02:00
parent 31151df169
commit e94ff861c7

View File

@@ -475,6 +475,10 @@ extension ExpandedPlayerWindowManager: NSWindowDelegate {
// Clear reference first so hide() becomes a no-op
playerWindow = nil
// Clear queue so closing the window fully ends the session,
// matching the close button behavior
appEnvironment?.queueManager.clearQueue()
// Stop player BEFORE cleaning up window to avoid crash
// The player must be stopped while views still exist to ensure
// proper cleanup of render resources