xcbOrg/Window: Destroy connections when no longer in use

This commit is contained in:
2025-07-25 01:21:26 -04:00
parent a17c940377
commit 270437fdd4
4 changed files with 61 additions and 12 deletions
+8
View File
@@ -126,6 +126,12 @@ public:
*/
static size_t getConnectionCount();
/**
* @brief Remove a specific connection from the manager
* @param id Connection identifier to remove
*/
static void removeConnection(const ConnectionIdentifier& id);
private:
static std::map<ConnectionIdentifier, std::shared_ptr<XcbConnection>> connections;
};
@@ -167,6 +173,8 @@ xcb_window_t findByName(xcb_connection_t* conn, xcb_window_t root,
typedef std::shared_ptr<xcb_xorg::XcbConnection> get_or_create_connection_fn(
int display, int screen);
typedef void cleanup_connections_fn();
typedef void dereference_connection_fn(
std::shared_ptr<xcb_xorg::XcbConnection> conn);
typedef xcb_window_t find_window_by_id_fn(
void* conn, xcb_window_t root, uint32_t targetId);
typedef xcb_window_t find_window_by_name_fn(void* conn, xcb_window_t root,