1
0

tclish_fini_callback.c 659 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * tclish_fini_callback.c
  3. *
  4. * Callback to restore the terminal settings
  5. */
  6. #ifdef HAVE_CONFIG_H
  7. #include "config.h"
  8. #endif /* HAVE_CONFIG_H */
  9. #ifdef HAVE_LIBTCL
  10. #include <stdlib.h>
  11. #include <tcl.h>
  12. #include "tcl_private.h"
  13. /*--------------------------------------------------------- */
  14. void tclish_fini_callback(const clish_shell_t * shell)
  15. {
  16. tclish_cookie_t *this = clish_shell__get_client_cookie(shell);
  17. /* cleanup the TCL interpreter */
  18. (void)Tcl_Release(this->interp);
  19. (void)Tcl_DeleteInterp(this->interp);
  20. /* free up memory */
  21. free(this);
  22. }
  23. /*--------------------------------------------------------- */
  24. #endif /* HAVE_LIBTCL */