diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-07-17 06:13:27 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-07-17 06:13:27 +0000 |
commit | 65deba3a350f760dacdb170fbecfa07edf4e4711 (patch) | |
tree | aa04b471d50b4cc7417c15f5e88fa588c8eafa2b /tmux.h | |
parent | 9642f0373f94d6015e66806c95ba1570c7bb06ea (diff) | |
download | rtmux-65deba3a350f760dacdb170fbecfa07edf4e4711.tar.gz rtmux-65deba3a350f760dacdb170fbecfa07edf4e4711.tar.bz2 rtmux-65deba3a350f760dacdb170fbecfa07edf4e4711.zip |
Memory could be leaked if a second prompt or message appeared while another was
still present, so add a separate prompt free callback and make the _clear
function responsible for calling it if necessary (rather than the individual
prompt callbacks). Also make both messages and prompts clear any existing when
a new is set.
In addition, the screen could be modified while the prompt is there, restore
the redraw-entire-screen behaviour on prompt clear; add a comment as a
reminder.
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -802,7 +802,8 @@ struct client { char *prompt_string; char *prompt_buffer; size_t prompt_index; - int (*prompt_callback)(void *, const char *); + int (*prompt_callbackfn)(void *, const char *); + void (*prompt_freefn)(void *); void *prompt_data; #define PROMPT_HIDDEN 0x1 @@ -1278,8 +1279,8 @@ int status_redraw(struct client *); void printflike2 status_message_set(struct client *, const char *, ...); void status_message_clear(struct client *); int status_message_redraw(struct client *); -void status_prompt_set(struct client *, - const char *, int (*)(void *, const char *), void *, int); +void status_prompt_set(struct client *, const char *, + int (*)(void *, const char *), void (*)(void *), void *, int); void status_prompt_clear(struct client *); int status_prompt_redraw(struct client *); void status_prompt_key(struct client *, int); |