Remove free callback for window_choose_data objects.

This commit is contained in:
Nicholas Marriott 2013-02-10 17:36:58 +00:00
parent 4d382ae8e6
commit aadc87f5a7
7 changed files with 7 additions and 13 deletions

View File

@ -91,7 +91,7 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
}
free(action);
window_choose_ready(wl->window->active, 0, NULL, NULL);
window_choose_ready(wl->window->active, 0, NULL);
return (CMD_RETURN_NORMAL);
}

View File

@ -101,7 +101,7 @@ cmd_choose_client_exec(struct cmd *self, struct cmd_ctx *ctx)
free(action);
window_choose_ready(wl->window->active, cur,
cmd_choose_client_callback, NULL);
cmd_choose_client_callback);
return (CMD_RETURN_NORMAL);
}

View File

@ -89,7 +89,7 @@ cmd_choose_list_exec(struct cmd *self, struct cmd_ctx *ctx)
return (CMD_RETURN_ERROR);
}
window_choose_ready(wl->window->active, 0, NULL, NULL);
window_choose_ready(wl->window->active, 0, NULL);
free(template);

View File

@ -227,7 +227,7 @@ windows_only:
free(final_win_template_middle);
free(final_win_template_last);
window_choose_ready(wl->window->active, cur_win, NULL, NULL);
window_choose_ready(wl->window->active, cur_win, NULL);
if (args_has(args, 'u'))
window_choose_expand_all(wl->window->active);

View File

@ -198,8 +198,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx)
window_choose_add(wl->window->active, cdata);
}
window_choose_ready(wl->window->active, 0, cmd_find_window_callback,
NULL);
window_choose_ready(wl->window->active, 0, cmd_find_window_callback);
out:
ARRAY_FREE(&find_list);

3
tmux.h
View File

@ -2198,8 +2198,7 @@ extern const struct window_mode window_choose_mode;
void window_choose_add(struct window_pane *,
struct window_choose_data *);
void window_choose_ready(struct window_pane *,
u_int, void (*)(struct window_choose_data *),
void (*)(struct window_choose_data *));
u_int, void (*)(struct window_choose_data *));
struct window_choose_data *window_choose_data_create (int,
struct client *, struct session *);
void window_choose_data_free(struct window_choose_data *);

View File

@ -103,8 +103,7 @@ window_choose_add(struct window_pane *wp, struct window_choose_data *wcd)
void
window_choose_ready(struct window_pane *wp, u_int cur,
void (*callbackfn)(struct window_choose_data *),
void (*freefn)(struct window_choose_data *))
void (*callbackfn)(struct window_choose_data *))
{
struct window_choose_mode_data *data = wp->modedata;
struct screen *s = &data->screen;
@ -116,7 +115,6 @@ window_choose_ready(struct window_pane *wp, u_int cur,
data->callbackfn = callbackfn;
if (data->callbackfn == NULL)
data->callbackfn = window_choose_default_callback;
data->freefn = freefn;
ARRAY_CONCAT(&data->old_list, &data->list);
@ -256,8 +254,6 @@ window_choose_free(struct window_pane *wp)
for (i = 0; i < ARRAY_LENGTH(&data->old_list); i++) {
item = &ARRAY_ITEM(&data->old_list, i);
if (data->freefn != NULL && item->wcd != NULL)
data->freefn(item->wcd);
window_choose_data_free(item->wcd);
free(item->name);
}