:orphan:
# SNESLineSearchDestroy
Destroys the line search instance.
## Synopsis
```
#include "petscsnes.h"
PetscErrorCode SNESLineSearchDestroy(SNESLineSearch *linesearch)
```
Collective
## Input Parameter
- ***linesearch -*** The linesearch context
## See Also
`SNESLineSearch`, `SNESGetLineSearch()`, `SNESLineSearchCreate()`, `SNESLineSearchReset()`, `SNESDestroy()`
## Level
developer
## Location
src/snes/linesearch/interface/linesearch.c
## Implementations
SNESLineSearchDestroy_BT in src/snes/linesearch/impls/bt/linesearchbt.c
SNESLineSearchDestroy_NLEQERR in src/snes/linesearch/impls/nleqerr/linesearchnleqerr.c
SNESLineSearchDestroy_Shell in src/snes/linesearch/impls/shell/linesearchshell.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/linesearch/interface/linesearch.c)
[Index of all SNES routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)