mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Plug two memory leaks
Plug two memory leaks introduced in the border drawing code.
This commit is contained in:
		
							parent
							
								
									3b5a8cb40d
								
							
						
					
					
						commit
						91d2a505b2
					
				
					 2 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -86,6 +86,8 @@ int get_font_text_height(const char *font) {
 | 
				
			||||||
	cairo_t *cr = cairo_create(surface);
 | 
						cairo_t *cr = cairo_create(surface);
 | 
				
			||||||
	int width, height;
 | 
						int width, height;
 | 
				
			||||||
	get_text_size(cr, font, &width, &height, "Gg");
 | 
						get_text_size(cr, font, &width, &height, "Gg");
 | 
				
			||||||
 | 
						cairo_surface_destroy(surface);
 | 
				
			||||||
 | 
						cairo_destroy(cr);
 | 
				
			||||||
	return height;
 | 
						return height;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,6 +64,7 @@ static void free_swayc(swayc_t *cont) {
 | 
				
			||||||
	if (cont->bg_pid != 0) {
 | 
						if (cont->bg_pid != 0) {
 | 
				
			||||||
		terminate_swaybg(cont->bg_pid);
 | 
							terminate_swaybg(cont->bg_pid);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						free(cont->border);
 | 
				
			||||||
	free(cont);
 | 
						free(cont);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue