glamor_egl: check for non NULL pixmap at egl_close_screen
DDX such as Xorg, Xwayland & Xephyr do not destroy the pixmap before they call into CloseScreen. At the same time Xvfb (support for glamor coming with later commit) do. As such the pixmap will be NULL and we'll crash out. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
15354fb68f
commit
7667180fb9
|
@ -770,8 +770,13 @@ glamor_egl_close_screen(ScreenPtr screen)
|
|||
screen_pixmap = screen->GetScreenPixmap(screen);
|
||||
pixmap_priv = glamor_get_pixmap_private(screen_pixmap);
|
||||
|
||||
eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
|
||||
pixmap_priv->image = NULL;
|
||||
/* For DDX like Xwayland and Xorg, the pixmap is not destroyed so
|
||||
* we should do so here.
|
||||
*/
|
||||
if (pixmap_priv) {
|
||||
eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
|
||||
pixmap_priv->image = NULL;
|
||||
}
|
||||
|
||||
screen->CloseScreen = glamor_egl->saved_close_screen;
|
||||
glamor_egl_cleanup(screen);
|
||||
|
|
Loading…
Reference in New Issue
Block a user