OK, thanks for the explanation. I wonder if we couldn't do the following instead
* remove `debug-connection.h` from the client API entirely. I expect clients to always use the API in `GjsInterruptRegister` instead of creating a `GjsDebugConnection` manually.
* have the functions in `GjsInterruptRegister` return a handle, e.g. an integer value, and have an API in `GjsInterruptRegister` itself to unregister an interrupt identified by its handle.
* handle all the callbacks that need to happen when an handle is removed internally in `GjsDebugInterruptRegister`. You could e.g. have an internal API that registers a callback through inserting a struct holding it in a hash table, keyed by the handle itself, and have that called when you're about to remove the struct from the hash table later.

Would that still satisfy the requirements, or am I going off track?