• Ulrich Sibiller's avatar
    Screen.c: Fix: make sure RRCloseScreen is being called · 3b06ad51
    Ulrich Sibiller authored
    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)
    3b06ad51
Name
Last commit
Last update
..
GL Loading commit data...
Xext Loading commit data...
Xi Loading commit data...
composite Loading commit data...
damageext Loading commit data...
dbe Loading commit data...
dix Loading commit data...
fb Loading commit data...
hw/nxagent Loading commit data...
include Loading commit data...
mi Loading commit data...
miext Loading commit data...
os Loading commit data...
randr Loading commit data...
record Loading commit data...
render Loading commit data...
xfixes Loading commit data...
xkb Loading commit data...
.gitignore Loading commit data...
Imakefile Loading commit data...
code-versions.txt Loading commit data...
fix-miregion Loading commit data...
fix-miregion-private Loading commit data...
fix-region Loading commit data...