• 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
debian Loading commit data...
doc Loading commit data...
etc Loading commit data...
m4 Loading commit data...
nx-X11 Loading commit data...
nxcomp Loading commit data...
nxcompshad Loading commit data...
nxdialog Loading commit data...
nxproxy Loading commit data...
testscripts Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
LICENSE Loading commit data...
LICENSE.nxcomp Loading commit data...
Makefile Loading commit data...
README.NX-development Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
fix-patch-whitespace Loading commit data...
make-changelog.sh Loading commit data...
mesa-quilt Loading commit data...
nx-libs.spec Loading commit data...
regenerate-symbol-docs.sh Loading commit data...
replace.sh Loading commit data...
roll-tarballs.sh Loading commit data...
run-static-analysis.sh Loading commit data...
version.sh Loading commit data...