---
name: "bson_writer_destroy"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_writer_destroy"
---

# bson\_writer\_destroy(3)

## SYNOPSIS

```
void
bson_writer_destroy (bson_writer_t *writer);
```

## PARAMETERS

- •

  **writer**: A *bson\_writer\_t*.

## DESCRIPTION

Cleanup after **writer** and release any allocated memory. Does nothing if **writer** is NULL. Note that the buffer supplied to *bson\_writer\_new()* is *NOT* freed from this method. The caller is responsible for that.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
