:orphan:
# PetscContainerSetUserDestroy
Sets name of the user destroy function for the data provided to the `PetscContainer` with `PetscContainerSetPointer()` 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscContainerSetUserDestroy(PetscContainer obj, PetscErrorCode (*des)(void *))
```
Logically Collective


## Input Parameters

- ***obj -*** an object that was created with `PetscContainerCreate()`
- ***des -*** name of the user destroy function





## Note
Use `PetscContainerUserDestroyDefault()` if the memory was obtained by calling `PetscMalloc()` or one of its variants for single memory allocation.


## See Also
 `PetscContainerDestroy()`, `PetscContainerUserDestroyDefault()`, `PetscMalloc()`, `PetscMalloc1()`, `PetscCalloc()`, `PetscCalloc1()`, `PetscObject`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/inherit.c.html#PetscContainerSetUserDestroy">src/sys/objects/inherit.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/inherit.c)


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