• 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
..
config Loading commit data...
extras Loading commit data...
include Loading commit data...
lib Loading commit data...
programs Loading commit data...
.gitignore Loading commit data...
Imakefile Loading commit data...
Makefile Loading commit data...
x-indent-all.sh Loading commit data...
x-indent.sh Loading commit data...