xcb_free_gc(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… 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 🌸πŸ’