render: picture.c.: move PictureScreenClose to post-hooks

This change is necessary to fix a segfault in intel driver at CloseScreen.
sna_early_close_screen() releases the glyph cache using FreePicture(), which needs
PictureScreen private of pScreen. It has already been released by PictureScreenClose(),
which is a pre-hook, and segfault occurs. Hence it is necessary to move
PictureScreenClose() to post-hooks.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
This commit is contained in:
Oleh Nykyforchyn
2025-07-18 09:50:32 +03:00
committed by Enrico Weigelt
parent 36125623fd
commit 5dc79405b5

View File

@@ -89,7 +89,7 @@ static void PictureScreenClose(CallbackListPtr *pcbl, ScreenPtr pScreen, void *u
SetPictureScreen(pScreen, 0);
free(ps->formats);
free(ps);
dixScreenUnhookClose(pScreen, PictureScreenClose);
dixScreenUnhookPostClose(pScreen, PictureScreenClose);
}
static void
@@ -683,7 +683,7 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
pScreen->StoreColors = PictureStoreColors;
dixScreenHookWindowDestroy(pScreen, picture_window_destructor);
dixScreenHookClose(pScreen, PictureScreenClose);
dixScreenHookPostClose(pScreen, PictureScreenClose);
if (!PictureSetDefaultFilters(pScreen)) {
PictureResetFilters(pScreen);