:orphan: # 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()`, `PetscObject` ## Level advanced ## Location src/sys/objects/inherit.c --- [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)