mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +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;
|
int y = 0;
|
||||||
|
|
||||||
if (im->blocks) {
|
if (im->blocks) {
|
||||||
while (im->blocks[y].ptr) {
|
|
||||||
MUTEX_LOCK(&ImagingDefaultArena.mutex);
|
MUTEX_LOCK(&ImagingDefaultArena.mutex);
|
||||||
|
while (im->blocks[y].ptr) {
|
||||||
memory_return_block(&ImagingDefaultArena, im->blocks[y]);
|
memory_return_block(&ImagingDefaultArena, im->blocks[y]);
|
||||||
MUTEX_UNLOCK(&ImagingDefaultArena.mutex);
|
|
||||||
y += 1;
|
y += 1;
|
||||||
}
|
}
|
||||||
|
MUTEX_UNLOCK(&ImagingDefaultArena.mutex);
|
||||||
free(im->blocks);
|
free(im->blocks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user