mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Bug fix: Add lock to newSharedImagePart
This commit is contained in:
parent
c5872c6640
commit
2903f32d9b
@ -17,6 +17,7 @@ package ebiten
|
||||
import (
|
||||
"github.com/hajimehoshi/ebiten/internal/bsp"
|
||||
"github.com/hajimehoshi/ebiten/internal/restorable"
|
||||
"github.com/hajimehoshi/ebiten/internal/sync"
|
||||
)
|
||||
|
||||
type sharedImage struct {
|
||||
@ -60,8 +61,12 @@ func (s *sharedImagePart) Dispose() {
|
||||
}
|
||||
}
|
||||
|
||||
var sharedImageLock sync.Mutex
|
||||
|
||||
func newSharedImagePart(width, height int) *sharedImagePart {
|
||||
// TODO: Lock!
|
||||
sharedImageLock.Lock()
|
||||
sharedImageLock.Unlock()
|
||||
|
||||
if width > bsp.MaxSize || height > bsp.MaxSize {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user