Commit 3b06ad51 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Screen.c: Fix: make sure RRCloseScreen is being called

Fixes ArcticaProject/nx-libs#598 In nxagentOpenScreen we first initialized the RRExtension for the screen and then replaced pScreen->CloseScreen by nxagentCloseScreen. This resulted in RandR's RRCloseScreen (and any other CloseScreen procedure installed by extensions) being no longer called. Moving RandR init after configuring pScreen->CloseScreen ensures the correct calling cascade: RRCloseScreen -> nxagentCloseScreen ->fbCloseScreen (called explicitly by nxagentCloseScreen). Which in turn will fix this memory leak: ==9688== 328 (312 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 271 of 319 ==9688== at 0x4837B65: calloc (vg_replace_malloc.c:752) ==9688== by 0x4ED2C6: RRScreenInit (randr.c:329) ==9688== by 0x1F2B18: nxagentInitRandRExtension (Extensions.c:122) ==9688== by 0x1DEAFF: nxagentOpenScreen (Screen.c:1409) ==9688== by 0x16D7F8: AddScreen (dispatch.c:4257) ==9688== by 0x1DA0CF: InitOutput (Init.c:397) ==9688== by 0x14DCC2: main (main.c:280)
parent 0f8dbbab
......@@ -1402,13 +1402,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
pScreen -> rootDepth = rootDepth;
/*
* Complete the initialization of the RANDR
* extension.
*/
nxagentInitRandRExtension(pScreen);
/*
* Set up the internal structures used for
* tracking the proxy resources associated
* to the unpack and split operations.
......@@ -1694,6 +1687,13 @@ N/A
nxagentOption(Height)) / 32)
}
/*
* Complete the initialization of the RANDR
* extension.
*/
nxagentInitRandRExtension(pScreen);
#ifdef TEST
nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:");
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment