Skip to content

Commit

Permalink
Make sure to close test windows to avoid memory leak in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed May 18, 2024
1 parent 26bd79a commit da6c5d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions widget/progressbarinfinite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestProgressBarInfinite_Creation(t *testing.T) {
assert.False(t, bar.Running())

win := test.NewWindow(bar)
defer win.Close()
win.Show()

// ticker should start automatically once the renderer is created
Expand All @@ -41,6 +42,7 @@ func TestProgressBarInfinite_Creation(t *testing.T) {
func TestProgressBarInfinite_Destroy(t *testing.T) {
bar := NewProgressBarInfinite()
win := test.NewWindow(bar)
defer win.Close()
win.Show()

assert.True(t, cache.IsRendered(bar))
Expand All @@ -57,6 +59,7 @@ func TestProgressBarInfinite_Destroy(t *testing.T) {
func TestProgressBarInfinite_Reshown(t *testing.T) {
bar := NewProgressBarInfinite()
win := test.NewWindow(bar)
defer win.Close()
win.Show()

assert.True(t, bar.Running())
Expand Down

0 comments on commit da6c5d5

Please sign in to comment.