:orphan:
# PCShellSetDestroy
Sets routine to use to destroy the user-provided application context. 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCShellSetDestroy(PC pc, PetscErrorCode (*destroy)(PC))
```
Logically Collective


## Input Parameters

- ***pc -*** the preconditioner context
- ***destroy -*** the application-provided destroy routine



## Calling sequence of `destroy`
```none
PetscErrorCode destroy(PC pc)
```

- ***pc -*** the preconditioner, get the application context with `PCShellGetContext()`





## See Also
 `PCSHELL`, `PCShellSetApply()`, `PCShellSetContext()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/shell/shellpc.c.html#PCShellSetDestroy">src/ksp/pc/impls/shell/shellpc.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex15.c.html">src/ksp/ksp/tutorials/ex15.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex15f.F90.html">src/ksp/ksp/tutorials/ex15f.F90</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex60.c.html">src/ksp/ksp/tutorials/ex60.c</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/shell/shellpc.c.html#PCShellSetDestroy_Shell(PC pc, PetscErrorCode (*destroy)">PCShellSetDestroy_Shell(PC pc, PetscErrorCode (*destroy) in src/ksp/pc/impls/shell/shellpc.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/shell/shellpc.c)


[Index of all PC routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
