---
name: "xcb_free_gc_checked"
section: "3"
platform: "linux"
package: "libxcb"
version: "1.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/xcb_free_gc"
---

# xcb\_free\_gc\_checked(3)

Destroys a graphics context

Part of [xcb\_free\_gc(3)](/xcb_free_gc/3.md).

## NAME

xcb\_free\_gc - Destroys a graphics context

## SYNOPSIS

**#include \<xcb/xproto.h\>**

### Request function

xcb\_void\_cookie\_t **xcb\_free\_gc**(xcb\_connection\_t \**conn*, xcb\_gcontext\_t *gc*);\

## REQUEST ARGUMENTS

- *conn*

  The XCB connection to X11.

- *gc*

  The graphics context to destroy.

## DESCRIPTION

Destroys the specified *gc* and all associated storage.

## RETURN VALUE

Returns an *xcb\_void\_cookie\_t*. Errors (if any) have to be handled in the event loop.

If you want to handle errors directly with *xcb\_request\_check* instead, use *xcb\_free\_gc\_checked*. See **[xcb-requests(3)](/xcb-requests/3.md)** for details.

## ERRORS

- *xcb\_g\_context\_error\_t*

  The specified graphics context does not exist.

## SEE ALSO

[**xcb-requests**(3)](/xcb-requests/3.md)

## AUTHOR

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
