[pango: 1/2] pangowin32: Don't leak various member variables of PangoWin32Font object
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango: 1/2] pangowin32: Don't leak various member variables of PangoWin32Font object
- Date: Mon, 5 Apr 2021 16:20:52 +0000 (UTC)
commit 32b85b8f345991533e716ec0f7b278849f5ed4e7
Author: Seungha Yang <seungha centricular com>
Date: Mon Apr 5 16:59:42 2021 +0900
pangowin32: Don't leak various member variables of PangoWin32Font object
Fix for memory leaks around PangoWin32Font
pango/pangowin32.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/pango/pangowin32.c b/pango/pangowin32.c
index 0a90182f..12b4a36e 100644
--- a/pango/pangowin32.c
+++ b/pango/pangowin32.c
@@ -820,10 +820,7 @@ pango_win32_font_finalize (GObject *object)
PangoWin32FontCache *cache = pango_win32_font_map_get_font_cache (win32font->fontmap);
PangoWin32Font *fontmap;
- if (G_UNLIKELY (!cache))
- return;
-
- if (win32font->hfont != NULL)
+ if (cache != NULL && win32font->hfont != NULL)
pango_win32_font_cache_unload (cache, win32font->hfont);
g_slist_foreach (win32font->metrics_by_lang, (GFunc)free_metrics_info, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]