# session_destroy

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L197
- **Page:** https://libtmux.org/en/tmux/3.7c/reference/c-function-session_destroy/

```c
void session_destroy(struct session *s, int notify, const char *from)
```

## Parameters

- `s` (`struct session *`)
- `notify` (`int`)
- `from` (`const char *`)

## Called by

- [`cmd_kill_session_exec`](/en/tmux/3.7c/reference/c-function-cmd-kill-session-c-cmd_kill_session_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-kill-session.c#L64)
- [`cmd_new_session_exec`](/en/tmux/3.7c/reference/c-function-cmd-new-session-c-cmd_new_session_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-new-session.c#L306)
- [`server_check_unattached`](/en/tmux/3.7c/reference/c-function-server_check_unattached/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L509)
- [`server_destroy_session_group`](/en/tmux/3.7c/reference/c-function-server-fn-c-server_destroy_session_group/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L398)
- [`server_send_exit`](/en/tmux/3.7c/reference/c-function-server-c-server_send_exit/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server.c#L328)
- [`window_tree_kill_each`](/en/tmux/3.7c/reference/c-function-window-tree-c-window_tree_kill_each/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L1114)

## Calls

- [`log_debug`](/en/tmux/3.7c/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L201)
- [`notify_session`](/en/tmux/3.7c/reference/c-function-notify_session/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L209)
- [`notify_session_window`](/en/tmux/3.7c/reference/c-function-notify_session_window/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L222)
- [`session_group_remove`](/en/tmux/3.7c/reference/c-function-session-c-session_group_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L216)
- [`session_remove_ref`](/en/tmux/3.7c/reference/c-function-session_remove_ref/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L228)
- [`winlink_remove`](/en/tmux/3.7c/reference/c-function-winlink_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L223)
- [`winlink_stack_remove`](/en/tmux/3.7c/reference/c-function-winlink_stack_remove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L219)

## Referenced declarations

- [`session.curw`](/en/tmux/3.7c/reference/c-struct-session-curw/) (attribute)
- [`session.cwd`](/en/tmux/3.7c/reference/c-struct-session-cwd/) (attribute)
- [`session.lastw`](/en/tmux/3.7c/reference/c-struct-session-lastw/) (attribute)
- [`session.lock_timer`](/en/tmux/3.7c/reference/c-struct-session-lock_timer/) (attribute)
- [`session.name`](/en/tmux/3.7c/reference/c-struct-session-name/) (attribute)
- [`session`](/en/tmux/3.7c/reference/c-struct-session/) (struct)
- [`session.tio`](/en/tmux/3.7c/reference/c-struct-session-tio/) (attribute)
- [`winlink.window`](/en/tmux/3.7c/reference/c-struct-winlink-window/) (attribute)
- [`session.windows`](/en/tmux/3.7c/reference/c-struct-session-windows/) (attribute)
