From 6510e11ae9e10f3669f5aab05cd08db71dea1df8 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 9 Aug 2022 12:57:53 +0300 Subject: Fix memory leak when accessing/listing system fonts. --- platform/linuxbsd/os_linuxbsd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp index e306c1054b..197d31dc81 100644 --- a/platform/linuxbsd/os_linuxbsd.cpp +++ b/platform/linuxbsd/os_linuxbsd.cpp @@ -368,6 +368,7 @@ Vector OS_LinuxBSD::get_system_fonts() const { FcPatternDestroy(pattern); } FcObjectSetDestroy(object_set); + FcConfigDestroy(config); for (const String &E : font_names) { ret.push_back(E); @@ -417,6 +418,8 @@ String OS_LinuxBSD::get_system_font_path(const String &p_font_name, bool p_bold, FcPatternDestroy(pattern); } FcObjectSetDestroy(object_set); + FcConfigDestroy(config); + return ret; #else ERR_FAIL_V_MSG(String(), "Godot was compiled without fontconfig, system font support is disabled."); -- cgit v1.2.3