mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
drm-lease-v1: fix error codepath
We were crashing in the error codepath [1] when wlr_drm_create_lease() fails. To fix this, delay the creation of the wlr_drm_lease_v1 until the request is granted. Previously we were allocating that struct early without populating the drm_lease field. However that means we ended up with a half-constructed struct in the error codepath which is annoying to handle. [1]: https://github.com/swaywm/sway/issues/7204#issuecomment-1269797356
This commit is contained in:
parent
3be6658ee7
commit
5c382f6344
2 changed files with 16 additions and 22 deletions
|
|
@ -71,8 +71,7 @@ struct wlr_drm_lease_request_v1 {
|
|||
struct wlr_drm_lease_connector_v1 **connectors;
|
||||
size_t n_connectors;
|
||||
|
||||
/** NULL until the lease is submitted */
|
||||
struct wlr_drm_lease_v1 *lease;
|
||||
struct wl_resource *lease_resource;
|
||||
|
||||
bool invalid;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue