mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Initialize alerts timer event where it is used, avoids crash with new windows.
This commit is contained in:
		
							
								
								
									
										9
									
								
								alerts.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								alerts.c
									
									
									
									
									
								
							| @@ -141,9 +141,11 @@ alerts_reset(struct window *w) | |||||||
| { | { | ||||||
| 	struct timeval	tv; | 	struct timeval	tv; | ||||||
|  |  | ||||||
|  | 	if (!event_initialized(&w->alerts_timer)) | ||||||
|  | 		evtimer_set(&w->alerts_timer, alerts_timer, w); | ||||||
|  |  | ||||||
| 	w->flags &= ~WINDOW_SILENCE; | 	w->flags &= ~WINDOW_SILENCE; | ||||||
| 	if (event_initialized(&w->alerts_timer)) | 	event_del(&w->alerts_timer); | ||||||
| 		event_del(&w->alerts_timer); |  | ||||||
|  |  | ||||||
| 	timerclear(&tv); | 	timerclear(&tv); | ||||||
| 	tv.tv_sec = options_get_number(w->options, "monitor-silence"); | 	tv.tv_sec = options_get_number(w->options, "monitor-silence"); | ||||||
| @@ -158,9 +160,6 @@ alerts_queue(struct window *w, int flags) | |||||||
| { | { | ||||||
| 	alerts_reset(w); | 	alerts_reset(w); | ||||||
|  |  | ||||||
| 	if (!event_initialized(&w->alerts_timer)) |  | ||||||
| 		evtimer_set(&w->alerts_timer, alerts_timer, w); |  | ||||||
|  |  | ||||||
| 	if ((w->flags & flags) != flags) { | 	if ((w->flags & flags) != flags) { | ||||||
| 		w->flags |= flags; | 		w->flags |= flags; | ||||||
| 		log_debug("@%u alerts flags added %#x", w->id, flags); | 		log_debug("@%u alerts flags added %#x", w->id, flags); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 nicm
					nicm