mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	util: clear pointers on wl_list_remove()
Set the next and prev pointers of the removed list element to NULL. This will catch programming errors that would use invalid list pointers, double-remove for instance. It also helps debugging, making it easy to see in gdb if an object is not in a list. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
		
							parent
							
								
									ab6b0738c6
								
							
						
					
					
						commit
						804d5dd348
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -49,6 +49,8 @@ wl_list_remove(struct wl_list *elm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	elm->prev->next = elm->next;
 | 
						elm->prev->next = elm->next;
 | 
				
			||||||
	elm->next->prev = elm->prev;
 | 
						elm->next->prev = elm->prev;
 | 
				
			||||||
 | 
						elm->next = NULL;
 | 
				
			||||||
 | 
						elm->prev = NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WL_EXPORT int
 | 
					WL_EXPORT int
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue