mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Move status line free into its own function.
This commit is contained in:
		@@ -281,13 +281,7 @@ server_client_lost(struct client *c)
 | 
				
			|||||||
	if (c->stderr_data != c->stdout_data)
 | 
						if (c->stderr_data != c->stdout_data)
 | 
				
			||||||
		evbuffer_free(c->stderr_data);
 | 
							evbuffer_free(c->stderr_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (event_initialized(&c->status.timer))
 | 
						status_free(c);
 | 
				
			||||||
		evtimer_del(&c->status.timer);
 | 
					 | 
				
			||||||
	screen_free(&c->status.status);
 | 
					 | 
				
			||||||
	if (c->status.old_status != NULL) {
 | 
					 | 
				
			||||||
		screen_free(c->status.old_status);
 | 
					 | 
				
			||||||
		free(c->status.old_status);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	free(c->title);
 | 
						free(c->title);
 | 
				
			||||||
	free((void *)c->cwd);
 | 
						free((void *)c->cwd);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								status.c
									
									
									
									
									
								
							@@ -296,7 +296,23 @@ status_get_window_at(struct client *c, u_int x)
 | 
				
			|||||||
	return (NULL);
 | 
						return (NULL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Draw status for client on the last lines of given context. */
 | 
					/* Free status line. */
 | 
				
			||||||
 | 
					void
 | 
				
			||||||
 | 
					status_free(struct client *c)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct status_line	*sl = &c->status;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (event_initialized(&sl->timer))
 | 
				
			||||||
 | 
							evtimer_del(&sl->timer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						screen_free(&sl->status);
 | 
				
			||||||
 | 
						if (sl->old_status != NULL) {
 | 
				
			||||||
 | 
							screen_free(sl->old_status);
 | 
				
			||||||
 | 
							free(sl->old_status);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* Draw status line for client. */
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
status_redraw(struct client *c)
 | 
					status_redraw(struct client *c)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1970,6 +1970,7 @@ void	 status_update_saved(struct session *);
 | 
				
			|||||||
int	 status_at_line(struct client *);
 | 
					int	 status_at_line(struct client *);
 | 
				
			||||||
u_int	 status_line_size(struct client *);
 | 
					u_int	 status_line_size(struct client *);
 | 
				
			||||||
struct window *status_get_window_at(struct client *, u_int);
 | 
					struct window *status_get_window_at(struct client *, u_int);
 | 
				
			||||||
 | 
					void	 status_free(struct client *);
 | 
				
			||||||
int	 status_redraw(struct client *);
 | 
					int	 status_redraw(struct client *);
 | 
				
			||||||
void printflike(2, 3) status_message_set(struct client *, const char *, ...);
 | 
					void printflike(2, 3) status_message_set(struct client *, const char *, ...);
 | 
				
			||||||
void	 status_message_clear(struct client *);
 | 
					void	 status_message_clear(struct client *);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user