From 5d0bf46e08fd59055afc713be9b48264afc7ce5c Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Wed, 24 Apr 2024 15:04:29 -0500 Subject: [PATCH] fix(player): Fix another bubblezone memory leak When a movie finishes, the default tea.Quit message is sent. This message does not get sent to our player, so the bubblezone instance is kept open resulting in a memory leak. --- internal/movie/player.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/movie/player.go b/internal/movie/player.go index 6e862aa8..decad7d2 100644 --- a/internal/movie/player.go +++ b/internal/movie/player.go @@ -91,7 +91,7 @@ func (p Player) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if p.log != nil { p.log.Info("Finished movie") } - return p, tea.Quit + return p, Quit } case p.frame <= 0: p.speed = 1 @@ -112,7 +112,7 @@ func (p Player) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if p.log != nil { p.log.Info("Finished movie") } - return p, tea.Quit + return p, Quit } else if p.frame+frameDiff <= 0 { p.speed = 1 p.activeOption = 4