mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Do not call window_unzoom from window_destroy because it will try to add
a notification which will get confused because the reference count is already zero and end up back in window_destroy and a double free. Instead, just destroy the layouts directly. Noticed by Thomas Adam.
This commit is contained in:
		
							
								
								
									
										6
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								window.c
									
									
									
									
									
								
							| @@ -341,12 +341,12 @@ window_create(const char *name, int argc, char **argv, const char *path, | |||||||
| void | void | ||||||
| window_destroy(struct window *w) | window_destroy(struct window *w) | ||||||
| { | { | ||||||
| 	window_unzoom(w); |  | ||||||
|  |  | ||||||
| 	RB_REMOVE(windows, &windows, w); | 	RB_REMOVE(windows, &windows, w); | ||||||
|  |  | ||||||
| 	if (w->layout_root != NULL) | 	if (w->layout_root != NULL) | ||||||
| 		layout_free(w); | 		layout_free_cell(w->layout_root); | ||||||
|  | 	if (w->saved_layout_root != NULL) | ||||||
|  | 		layout_free_cell(w->saved_layout_root); | ||||||
| 	free(w->old_layout); | 	free(w->old_layout); | ||||||
|  |  | ||||||
| 	if (event_initialized(&w->name_timer)) | 	if (event_initialized(&w->name_timer)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 nicm
					nicm