mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	scene/output_layout: Add assert for duplicate output insertion
Ensure that the output was not added multiple times to the scene output layout.
This commit is contained in:
		
							parent
							
								
									96690d6380
								
							
						
					
					
						commit
						291431c14f
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -73,7 +73,12 @@ void wlr_scene_output_layout_add_output(struct wlr_scene_output_layout *sol,
 | 
				
			||||||
		struct wlr_output_layout_output *lo, struct wlr_scene_output *so) {
 | 
							struct wlr_output_layout_output *lo, struct wlr_scene_output *so) {
 | 
				
			||||||
	assert(lo->output == so->output);
 | 
						assert(lo->output == so->output);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct wlr_scene_output_layout_output *solo = calloc(1, sizeof(*solo));
 | 
						struct wlr_scene_output_layout_output *solo;
 | 
				
			||||||
 | 
						wl_list_for_each(solo, &sol->outputs, link) {
 | 
				
			||||||
 | 
							assert(solo->scene_output != so);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						solo = calloc(1, sizeof(*solo));
 | 
				
			||||||
	if (solo == NULL) {
 | 
						if (solo == NULL) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue