mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +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) {
 | 
			
		||||
        while (im->blocks[y].ptr) {
 | 
			
		||||
        MUTEX_LOCK(&ImagingDefaultArena.mutex);
 | 
			
		||||
        while (im->blocks[y].ptr) {
 | 
			
		||||
            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