mirror of
https://github.com/Dadido3/noita-mapcap.git
synced 2024-11-18 17:17:31 +00:00
Fix image caching
This commit is contained in:
parent
baea6292f1
commit
6f2be8486e
@ -79,11 +79,11 @@ func (it *imageTile) GetImage() (*image.RGBA, error) {
|
|||||||
|
|
||||||
it.image = imgRGBA
|
it.image = imgRGBA
|
||||||
|
|
||||||
// Free the image after some time
|
// Free the image after some time.
|
||||||
go func() {
|
go func() {
|
||||||
for it.imageUsedFlag {
|
for it.imageUsedFlag {
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
it.imageUsedFlag = false
|
it.imageUsedFlag = false
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
it.imageMutex.Lock()
|
it.imageMutex.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user