1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00
Files
wmaker/WPrefs.app/Appearance.c
Christophe CURIS be4849448f WPrefs: fix memory leak when storing the list of texture in Appearence panel (Coverity #50112)
As pointed by Coverity, the PLStrings created to store the information on
the texture leak. This is due to the fact that they are created with a
refCount of 1, then the PLArray in which they are placed increments that
count, so at list destruction the count would return to 1 instead of 0,
meaning the PLStrings won't be freed.

This patch release the PLStrings once after adding them to the PLArray so
the count will go back to 1, which means they will be properly freed when
the PLArray will be released.

Took opportunity to remove the call to WMRetainPropList on the titem-prop
because it artificially increases the refCount but this is already done
when adding to the PLArray.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:18 +00:00

62 KiB