From 6852aa7e59ec13b00377d32f9f46692f0b32eff5 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Tue, 9 Jul 2024 14:16:39 -0700 Subject: [PATCH] Fix #420: check if artist page has been disposed before loading info --- ui/browsing/artistpage.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/browsing/artistpage.go b/ui/browsing/artistpage.go index 51adb9f..f5b72af 100644 --- a/ui/browsing/artistpage.go +++ b/ui/browsing/artistpage.go @@ -72,7 +72,6 @@ func newArtistPage(artistID string, cfg *backend.ArtistPageConfig, pool *util.Wi a.ExtendBaseWidget(a) if h := a.pool.Obtain(util.WidgetTypeArtistPageHeader); h != nil { a.header = h.(*ArtistPageHeader) - a.header.artistPage = a a.header.Clear() } else { a.header = NewArtistPageHeader(a) @@ -181,7 +180,9 @@ func (a *ArtistPage) load() { if err != nil { log.Printf("Failed to get artist info: %s", err.Error()) } - a.header.UpdateInfo(info) + if !a.disposed { + a.header.UpdateInfo(info) + } } func (a *ArtistPage) showAlbumGrid() { @@ -296,7 +297,7 @@ type ArtistPageHeader struct { playRadioBtn *widget.Button menuBtn *widget.Button container *fyne.Container - shareMenuItem *fyne.MenuItem + //shareMenuItem *fyne.MenuItem } func NewArtistPageHeader(page *ArtistPage) *ArtistPageHeader {