Skip to content

Commit

Permalink
Pass function directly instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Dec 5, 2023
1 parent b005cdf commit 9cc314f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ func (w *window) Close() {
w.viewLock.Unlock()
w.viewport.SetShouldClose(true)

painter := w.canvas.Painter()
cache.RangeTexturesFor(w.canvas, func(obj fyne.CanvasObject) {
painter.Free(obj)
})
cache.RangeTexturesFor(w.canvas, w.canvas.Painter().Free)
})

w.canvas.WalkTrees(nil, func(node *common.RenderCacheNode, _ fyne.Position) {
Expand Down
5 changes: 1 addition & 4 deletions internal/driver/mobile/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ func (w *window) Close() {
d.windows = append(d.windows[:pos], d.windows[pos+1:]...)
}

painter := w.canvas.Painter()
cache.RangeTexturesFor(w.canvas, func(obj fyne.CanvasObject) {
painter.Free(obj)
})
cache.RangeTexturesFor(w.canvas, w.canvas.Painter().Free)

w.canvas.WalkTrees(nil, func(node *common.RenderCacheNode, _ fyne.Position) {
if wid, ok := node.Obj().(fyne.Widget); ok {
Expand Down

0 comments on commit 9cc314f

Please sign in to comment.