---
name: "idr_destroy"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/idr_destroy"
---

# idr\_destroy(9)

release all cached layers within an idr tree

## NAME

idr\_destroy - release all cached layers within an idr tree

## SYNOPSIS

**void idr\_destroy(struct idr \*** *idp***);**

## ARGUMENTS

*idp*

idr handle

## DESCRIPTION

Free all id mappings and all idp\_layers. After this function, *idp* is completely unused and can be freed / recycled. The caller is responsible for ensuring that no one else accesses *idp* during or after **idr\_destroy**.

A typical clean-up sequence for objects stored in an idr tree will use **idr\_for\_each** to free all objects, if necessary, then **idr\_destroy** to free up the id mappings and cached idr\_layers.

## COPYRIGHT
