Backend returns CanvasCloser

This commit is contained in:
Sasha Koshka 2024-06-03 20:43:05 -04:00
parent 006921d690
commit 0d93d73c32
2 changed files with 3 additions and 2 deletions

View File

@ -126,7 +126,7 @@ func (this *Backend) NewTexture (source image.Image) canvas.TextureCloser {
return xcanvas.NewTextureFrom(source)
}
func (this *Backend) NewCanvas (bounds image.Rectangle) canvas.Canvas {
func (this *Backend) NewCanvas (bounds image.Rectangle) canvas.CanvasCloser {
return xcanvas.NewCanvas(this.x, bounds)
}

View File

@ -49,9 +49,10 @@ func (this *Canvas) Push (window xproto.Window) {
}
// Close frees this canvas from the X server.
func (this *Canvas) Close () {
func (this *Canvas) Close () error {
this.assert()
this.Image.Destroy()
return nil
}
func (this *Canvas) assert () {