Skip to content

backends/x11: Prevent uneven error traps init/deinit on GInitable failure

GInitable initialization is failable, currently, it may fail before error traps are initialized, but error traps would be invariably deinitialized on finalize() of the failed object. This results in an assert hit, on top of the original failure to initialize the backend.

The libX11 error handlers are a pure client-side construct, and not a server request, they just need XInitThreads() called to set up the library-side locks protecting access to the global variable. This is done beforehand already at meta_backend_x11_init(), so we can shuffle error trap initialization within GInitable::init() so it happens before any of the possible error situations.

Merge request reports