diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2013-02-25 23:37:16 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2013-02-25 23:37:16 -0500 |
commit | 0654dfb2ddc66fe70cd5582ccc0ec08ba8154ac6 (patch) | |
tree | 57ddf6d270637558bac345f45585457d371f1b3a /pango/pangowin32-fontmap.c | |
parent | b740729a6dfe58b0d8673a48ae96626ff851c122 (diff) | |
download | pango-0654dfb2ddc66fe70cd5582ccc0ec08ba8154ac6.tar.gz |
[win32] Fix assertion and warnings
When win32 fontmap goes away, font->fontmap becomes NULL. Deal
with that. Technically speaking, we need to port this to GWeakRef
like the other fontmaps do. But this would do for now.
Diffstat (limited to 'pango/pangowin32-fontmap.c')
-rw-r--r-- | pango/pangowin32-fontmap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c index 5dc2a826..460afb21 100644 --- a/pango/pangowin32-fontmap.c +++ b/pango/pangowin32-fontmap.c @@ -1701,7 +1701,9 @@ pango_win32_face_get_type (void) PangoWin32FontCache * pango_win32_font_map_get_font_cache (PangoFontMap *font_map) { - g_return_val_if_fail (font_map != NULL, NULL); + if (G_UNLIKELY (!font_map)) + return NULL; + g_return_val_if_fail (PANGO_WIN32_IS_FONT_MAP (font_map), NULL); return PANGO_WIN32_FONT_MAP (font_map)->font_cache; |