diff options
author | Tor Lillqvist <tml@iki.fi> | 2002-11-12 04:11:02 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2002-11-12 04:11:02 +0000 |
commit | ceaeb6f33f43a9efe31e6549b3aad3d4a88a03e9 (patch) | |
tree | d4afe5480b77cca6cd6b743238b3634ffc5d893f /modules | |
parent | 23c23546a22a785be7eca60f4bc59f7723456ffe (diff) | |
download | pango-ceaeb6f33f43a9efe31e6549b3aad3d4a88a03e9.tar.gz |
Add more debugging output.
2002-11-12 Tor Lillqvist <tml@iki.fi>
* pango/pangowin32-fontcache.c (free_cache_entry,
cache_entry_unref, pango_win32_font_cache_load): Add more
debugging output.
* modules/basic/basic-win32.c (uniscribe_shape): Plug memory leak:
Free return value from pango_win32_font_logfont(). Call
pango_win32_font_cache_unload() for the hfont returned from
pango_win32_font_cache_load() after using it.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/basic/basic-win32.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c index f2dedd98..1b5cf8b2 100644 --- a/modules/basic/basic-win32.c +++ b/modules/basic/basic-win32.c @@ -835,7 +835,8 @@ uniscribe_shape (PangoFont *font, int wlen, i; gboolean retval = TRUE; GError *error; - HGDIOBJ old_font; + HGDIOBJ old_font = NULL; + HFONT hfont = NULL; LOGFONT *lf; SCRIPT_CACHE script_cache[100]; @@ -847,7 +848,15 @@ uniscribe_shape (PangoFont *font, wlen /= 2; lf = pango_win32_font_logfont (font); - old_font = SelectObject (hdc, pango_win32_font_cache_load (font_cache, lf)); + hfont = pango_win32_font_cache_load (font_cache, lf); + g_free (lf); + + if (hfont == NULL) + retval = FALSE; + + if (retval) + old_font = SelectObject (hdc, hfont); + if (old_font == NULL) { #ifdef BASIC_WIN32_DEBUGGING @@ -887,6 +896,9 @@ uniscribe_shape (PangoFont *font, if (old_font != NULL) SelectObject (hdc, old_font); + if (hfont != NULL) + pango_win32_font_cache_unload (font_cache, hfont); + return retval; } |