terminal: Only wipe buffer terminal_close wasn't called

After @250aca4f8938 it is possible that terminal_close will be called without
invoking the close_cb(which normally destroys the terminal structure). If this
happens, the terminal buffer will already be deleted so there's no need to call
`bwipeout!`.
This commit is contained in:
Thiago de Arruda 2015-08-21 13:10:34 -03:00
parent cb87670ff8
commit 3d2d44037f

View File

@ -423,7 +423,9 @@ end:
ui_busy_stop();
if (close) {
term->opts.close_cb(term->opts.data);
do_cmdline_cmd("bwipeout!");
if (term->buf) {
do_cmdline_cmd("bwipeout!");
}
}
}