diff --git a/pixelgl/window.go b/pixelgl/window.go index e76aaf2..74b69d4 100644 --- a/pixelgl/window.go +++ b/pixelgl/window.go @@ -132,9 +132,9 @@ func NewWindow(cfg WindowConfig) (*Window, error) { runtime.SetFinalizer(w, (*Window).Destroy) imgs := make([]image.Image, len(cfg.Icon)) - for _, v := range cfg.Icon { + for i, v := range cfg.Icon { pic := pixel.PictureDataFromPicture(v) - imgs = append(imgs, pic.Image()) + imgs[i] = pic.Image() } mainthread.Call(func() { w.window.SetIcon(imgs)