QB_HDB_HANDLE_DESTROY(3)

✨ qb_hdb_handle_destroy ✨

okay bestie, pull up a chair, we're reading a page from the libqb Programmer's Manual and it's honestly a short one but it's so important πŸ’–


🌸 NAME 🌸

qb_hdb_handle_destroy β€” Request the destruction of the object.

like, you're politely asking the object to go away. you're not doing it yourself, you're requesting. main character energy but make it a function call πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <qb/qbhdb.h>

int32_t qb_hdb_handle_destroy(
    struct qb_hdb   *hdb,        /* the database instance */
    qb_handle_t      handle_in   /* the handle */
);

πŸ¦‹ PARAMS πŸ¦‹

  • hdb β€” the database instance πŸ—‚οΈ
  • handle_in β€” the handle 🏷️

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the whole vibe: when the refcount is 0, it will be destroyed. that's it. that's the tea β˜• the object doesn't dip out while people are still holding onto it β€” it waits, and once nobody's counting on it anymore, poof, gone 🫢


🧚 STRUCTURES 🧚

the way this struct is literally just sitting here, iconic:

struct qb_hdb {
    uint32_t    handle_count;
    qb_array_t  handles;
    uint32_t    iterator;
    void      (*destructor)(void *);
    uint32_t    first_run;
};

🌈 RETURN VALUE 🌈

(0 == ok, -errno failure)

so like, 0 means slay πŸ’š, anything -errno means it's giving problem 😭


πŸ’– SEE ALSO πŸ’–

the whole friend group, fr fr:


Copyright (C) 2010-2020 Red Hat, Inc.


lowkey reminder: this is a request, not a demand. the destruction only actually happens once the refcount hits 0. respect the count, bestie πŸ™ˆ

and that's a wrap on the qb_hdb_handle_destroy(3) page from the libqb Programmer's Manual, dated 2025-09-16 πŸŽ€πŸ’– no cap, you understood all of it, periodt βœ¨πŸ¦‹

πŸ“¦ where this page comes from