---
name: "waffle_teardown"
section: "3"
platform: "linux"
package: "libwaffle-doc"
version: "1.8.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/waffle_teardown"
---

# waffle\_teardown(3)

Teardown waffle's per-process global state

## NAME

waffle\_teardown - Teardown waffle's per-process global state

## SYNOPSIS

```
#include <waffle.h>
```

**bool waffle\_teardown(void);**

## DESCRIPTION

Feature test macro: WAFFLE\_API\_VERSION \>= 0x0106. (See [**waffle\_feature\_test\_macros**(7)](/waffle_feature_test_macros/7.md)).

**waffle\_teardown()** tears down the per-process global state of the waffle library.

А call to **waffle\_teardown()** can fail. In the case it does the caller is advised to use **waffle\_error\_get\_info**, **waffle\_error\_get\_code** and/or **waffle\_error\_to\_string** to retrieve the error. In case of an error that differs from **WAFFLE\_ERROR\_NOT\_INITIALIZED** the caller should not use the Waffle API as the global state is likely to be in an undetermined/corrupt. In the case of **WAFFLE\_ERROR\_NOT\_INITIALIZED** one should call **waffle\_init()** prior to reusing Waffle.

## RETURN VALUE

Functions whose return type is **bool** return true on success and false on failure. Functions whose return type is a pointer return **NULL** on failure. Use [**waffle\_error\_get\_info**(3)](/waffle_error_get_info/3.md) to get information about any errors.

## ERRORS

See [**waffle\_error**(3)](/waffle_error/3.md) for the complete list of waffle's error codes.

**WAFFLE\_ERROR\_NOT\_INITIALIZED**

Waffle has not been initialized with a successful call to **waffle\_init()** since the last call to **waffle\_teardown()** or the start of the program.

## ISSUES

Please report bugs or and feature requests to **https://gitlab.freedesktop.org/mesa/waffle/issues**.

## SEE ALSO

[**waffle\_init**(3)](/waffle_init/3.md),

[**waffle**(7)](/waffle/7.md).

## AUTHOR

**Emil Velikov** \<emil.l.velikov@gmail.com\>

Maintainer

## COPYRIGHT

Copyright © 2013 Intel\

This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To view a copy of this license, visit **http://creativecommons.org.license/by-sa/3.0/us**.
