# PetscObjectDereference
Indicates to any `PetscObject` that it is being referenced by one less `PetscObject`. This decreases the reference count for that object by one. 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscObjectDereference(PetscObject obj)
```
Collective on obj if reference reaches 0 otherwise Logically Collective


## Input Parameter

- ***obj -*** the PETSc object; this must be cast with (`PetscObject`), for example,
`PetscObjectDereference`((`PetscObject`)mat);



## Note
`PetscObjectDestroy()` sets the obj pointer to null after the call, this routine does not.




## See Also
 `PetscObjectCompose()`, `PetscObjectReference()`, `PetscObjectDestroy()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/inherit.c.html#PetscObjectDereference">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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
