1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-06-26 10:52:35 +00:00

Fix memory leaks in X11 display backend (#1483)

* display-x11: fix memory leaks

FcFini() was never being called, which meant FontConfig did not clean up its internal storage.

furthermore, restore a commented-out call to XftFontClose()

9acf0bb4c commented this call out, but it does not seem to cause any problems now on reload now

* feat: Move docs to website, rearrange bits (#1475)

* build(deps): bump actions/stale from 7 to 8 (#1472)

Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add fontconfig platform checks

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: bi4k8 <bi4k8@github>
Co-authored-by: Brenden Matthews <brenden@brndn.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brenden Matthews <github@brenden.brndn.io>
This commit is contained in:
bi4k8 2023-03-31 16:54:20 +00:00 committed by GitHub
parent 3b1c9a7cc1
commit dab87c5246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -370,7 +370,10 @@ if(BUILD_X11)
message(FATAL_ERROR "Unable to find Xft library")
endif(NOT X11_Xft_FOUND)
set(conky_libs ${conky_libs} ${X11_Xft_LIB})
find_package(Fontconfig REQUIRED)
set(conky_libs ${conky_libs} ${X11_Xft_LIB} ${Fontconfig_LIBRARIES})
set(conky_includes ${conky_includes} ${FREETYPE_INCLUDE_DIR_freetype2} ${Fontconfig_INCLUDE_DIRS})
endif(BUILD_XFT)
# check for Xdbe

View File

@ -603,6 +603,9 @@ void display_output_x11::cleanup() {
XDestroyRegion(x11_stuff.region);
x11_stuff.region = nullptr;
}
#ifdef BUILD_XFT
FcFini();
#endif /* BUILD_XFT */
}
void display_output_x11::set_foreground_color(Colour c) {
@ -824,13 +827,8 @@ void display_output_x11::free_fonts(bool utf8) {
for (auto &font : x_fonts) {
#ifdef BUILD_XFT
if (use_xft.get(*state)) {
/*
* Do we not need to close fonts with Xft? Unsure. Not freeing the
* fonts seems to incur a slight memory leak, but it also prevents
* a crash.
*
* XftFontClose(display, x_fonts[i].xftfont);
*/
/* Close each font if it has been initialized */
if (font.xftfont) { XftFontClose(display, font.xftfont); }
} else
#endif /* BUILD_XFT */
{