mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-10 13:29:48 -05:00
compositor: Use a virtual destructor when shutting down
Backend can now rely on their destroy function getting called on shutdown, so reset tty etc there instead of handling SIGTERM twice.
This commit is contained in:
parent
50dc6989b8
commit
caa6442556
5 changed files with 31 additions and 16 deletions
|
|
@ -507,6 +507,12 @@ wayland_compositor_handle_event(int fd, uint32_t mask, void *data)
|
|||
wl_display_iterate(c->parent.display, WL_DISPLAY_WRITABLE);
|
||||
}
|
||||
|
||||
static void
|
||||
wayland_destroy(struct wlsc_compositor *ec)
|
||||
{
|
||||
free(ec);
|
||||
}
|
||||
|
||||
struct wlsc_compositor *
|
||||
wayland_compositor_create(struct wl_display *display, int width, int height)
|
||||
{
|
||||
|
|
@ -556,6 +562,7 @@ wayland_compositor_create(struct wl_display *display, int width, int height)
|
|||
if (c->parent.wl_source == NULL)
|
||||
return NULL;
|
||||
|
||||
c->base.destroy = wayland_destroy;
|
||||
c->base.authenticate = wayland_authenticate;
|
||||
c->base.present = wayland_compositor_present;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue