client: Fix segmentation fault in the case weston-nested
authorYong Gan <yong.gan@nxp.com>
Tue, 5 Sep 2017 00:00:30 +0000 (08:00 +0800)
committerDaniel Stone <daniels@collabora.com>
Thu, 7 Jun 2018 17:07:08 +0000 (18:07 +0100)
eglTerminate should be called before the display was disconnected.

Signed-off-by: Yong Gan <yong.gan@nxp.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
clients/nested-client.c

index 5027075..70bb4d1 100644 (file)
@@ -343,10 +343,10 @@ nested_client_destroy(struct nested_client *client)
                wl_compositor_destroy(client->compositor);
 
        wl_registry_destroy(client->registry);
-       wl_display_flush(client->display);
-       wl_display_disconnect(client->display);
        eglTerminate(client->egl_display);
        eglReleaseThread();
+       wl_display_flush(client->display);
+       wl_display_disconnect(client->display);
 }
 
 int