mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Address feedback; do not lock in a loop
This commit is contained in:
parent
5999b9b0cc
commit
06767fc325
|
@ -369,12 +369,12 @@ ImagingDestroyArray(Imaging im) {
|
|||
int y = 0;
|
||||
|
||||
if (im->blocks) {
|
||||
MUTEX_LOCK(&ImagingDefaultArena.mutex);
|
||||
while (im->blocks[y].ptr) {
|
||||
MUTEX_LOCK(&ImagingDefaultArena.mutex);
|
||||
memory_return_block(&ImagingDefaultArena, im->blocks[y]);
|
||||
MUTEX_UNLOCK(&ImagingDefaultArena.mutex);
|
||||
y += 1;
|
||||
}
|
||||
MUTEX_UNLOCK(&ImagingDefaultArena.mutex);
|
||||
free(im->blocks);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user