xcb_free_gc(3)
π xcb_free_gc β from the XCB Requests corner of the manual
okay bestie, so this is xcb_free_gc(3) from the XCB Requests chapter, and it's genuinely one of the most satisfying little calls in the whole library. let's get into it π«Ά
β¨ NAME β¨
xcb_free_gc β Destroys a graphics context
like. it literally says what it does. iconic behaviour honestly π
β¨ 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. your link to the server, your main character connection πgcβ The graphics context to destroy. yes queen, we're taking it out. no survivors π¦
β¨ DESCRIPTION β¨
Destroys the specified gc and all associated storage.
that's it. that's the whole vibe. one call, and everything attached to that graphics context is gone β poof, storage reclaimed, cleanup complete. it's giving spring cleaning π§Ήβ¨
β¨ RETURN VALUE β¨
Returns an xcb_void_cookie_t. Errors (if any) have to be handled in the event loop.
not me having to actually deal with the cookie later π this is a void cookie bestie, meaning there's no reply data coming back β but errors can still show up, and you gotta catch them 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) for details.
so basically: async girlies use xcb_free_gc + the event loop, and the immediate-feedback girlies use xcb_free_gc_checked + xcb_request_check. both are valid, pick your fighter π
β¨ ERRORS β¨
xcb_g_context_error_tβ The specified graphics context does not exist.
π you tried to free a gc that isn't there. the server said "who?? never heard of her." make sure your gc is real and alive before you go destroying it, fr fr.
β¨ SEE ALSO β¨
β¨ AUTHOR β¨
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
okay that's the whole page bestie, you ate that πβ¨ now go forth and free your graphics contexts responsibly ππ¦
this was brought to you by X Version 11, libxcb 1.17.0, and the date that shall live in manpage footers forever β stay slay, stay compiled, and don't leak your gcs πΈπ
π¦ where this page comes from
- alpine 3.22: libxcb-doc 1.17.0-r0 Β· MIT
- alpine 3.23: libxcb-doc 1.17.0-r1 Β· MIT
- alpine 3.24: libxcb-doc 1.17.0-r2 Β· MIT
- arch rolling: libxcb 1.17.0-1 Β· X11
- centos-stream 10: libxcb-devel 1.17.0-3.el10 Β· X11
- debian trixie: libxcb-doc 1.17.0-2
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- nixpkgs unstable: libxcb 1.17.0
- opensuse-leap 16.0: libxcb-devel-doc 1.17.0-160000.2.2 Β· MIT
- ubuntu questing: libxcb-doc 1.17.0-2build1
- ubuntu resolute: libxcb-doc 1.17.0-2ubuntu1
- ubuntu stonking: libxcb-doc 1.17.0-2ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms