main: Create black surface after listening socket 04/25404/2
authorWalter Lozano <walter.lozano@collabora.com>
Thu, 8 Oct 2020 02:19:45 +0000 (02:19 +0000)
committerWalter Lozano <walter.lozano@collabora.com>
Thu, 8 Oct 2020 13:14:38 +0000 (10:14 -0300)
commit51a77a42b4003d25fbf8193ae6122fd95fd1489a
treeb70767fc10016d7e876ed0dfe3efde7bdf3363dd
parent9bb8ea6f6156502bf1639ce349907b391e9b124d
main: Create black surface after listening socket

If agl-compositor is started without XDG_RUNTIME_DIR defined, an error
arises and the system tries to exit cleanly. However, in this process a
segfault is produced and the terminal is left misconfigured.

The cause of this segfault is related to the destruction of the black
surface, which is not handled properly in this corner case.

In order to avoid this issue and as an initial fix, create the surface
after the listening socket, which causes that the check for the var
XDG_RUNTIME_DIR to be done before the surface creation.

Bug-AGL: SPEC-3623

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Change-Id: I04760828f9ce5b5a6d4a31aeccdefe779a1c15a3
src/main.c