1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #include "private.h"
- #include "lub/string.h"
- #include <stdlib.h>
- static void clish_shell_fini(clish_shell_t * this)
- {
- clish_view_t *view;
- clish_ptype_t *ptype;
- unsigned i;
-
- while ((view = lub_bintree_findfirst(&this->view_tree))) {
-
- lub_bintree_remove(&this->view_tree, view);
-
- clish_view_delete(view);
- }
-
- while ((ptype = lub_bintree_findfirst(&this->ptype_tree))) {
-
- lub_bintree_remove(&this->ptype_tree, ptype);
-
- clish_ptype_delete(ptype);
- }
-
- lub_string_free(this->overview);
- lub_string_free(this->viewid);
- if (NULL != this->startup) {
-
- clish_command_delete(this->startup);
- }
-
- while (BOOL_TRUE == clish_shell_pop_file(this)) {
-
- }
-
- clish_shell_tinyrl_delete(this->tinyrl);
-
- for (i = 0; i < this->cfg_pwdc; i++) {
- lub_string_free(this->cfg_pwdv[i]->line);
- lub_string_free(this->cfg_pwdv[i]->viewid);
- free(this->cfg_pwdv[i]);
- }
-
- free(this->cfg_pwdv);
- this->cfg_pwdc = 0;
- this->cfg_pwdv = NULL;
- konf_client_free(this->client);
- if (this->completion_pargv) {
- clish_pargv_delete(this->completion_pargv);
- this->completion_pargv = NULL;
- }
-
- clish_param_delete(this->param_depth);
- clish_param_delete(this->param_pwd);
- lub_string_free(this->lockfile);
- }
- void clish_shell_delete(clish_shell_t * this)
- {
- if (this->client_hooks->fini_fn) {
-
- this->client_hooks->fini_fn(this);
- }
- clish_shell_fini(this);
- free(this);
- }
|