ImageData: remove automatic mutex locks.

This commit is contained in:
Sasha Szpakowski
2024-02-18 17:06:40 -04:00
parent d880c48502
commit 007090af14
9 changed files with 25 additions and 123 deletions
+1 -7
View File
@@ -1065,13 +1065,7 @@ bool Window::setIcon(love::image::ImageData *imgd)
int bytesperpixel = (int) getPixelFormatBlockSize(imgd->getFormat());
int pitch = w * bytesperpixel;
SDL_Surface *sdlicon = nullptr;
{
// We don't want another thread modifying the ImageData mid-copy.
love::thread::Lock lock(imgd->getMutex());
sdlicon = SDL_CreateRGBSurfaceFrom(imgd->getData(), w, h, bytesperpixel * 8, pitch, rmask, gmask, bmask, amask);
}
SDL_Surface *sdlicon = SDL_CreateRGBSurfaceFrom(imgd->getData(), w, h, bytesperpixel * 8, pitch, rmask, gmask, bmask, amask);
if (!sdlicon)
return false;