From 1db48180f2bb36901a6a05d86f0f0d00e70c538e Mon Sep 17 00:00:00 2001 From: Phil Krylov Date: Wed, 1 Feb 2006 12:30:26 +0100 Subject: [PATCH] riched20: Fixed font cache corruption. --- dlls/riched20/style.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c index 56f9842bb6c..804cc1649b8 100644 --- a/dlls/riched20/style.c +++ b/dlls/riched20/style.c @@ -317,7 +317,7 @@ HFONT ME_SelectStyleFont(ME_TextEditor *editor, HDC hDC, ME_Style *s) if (item->nAge > nAge) nEmpty = i, nAge = item->nAge; } - if (ME_IsFontEqual(&item->lfSpecs, &lf)) + if (item->hFont && ME_IsFontEqual(&item->lfSpecs, &lf)) break; } if (i < HFONT_CACHE_SIZE) /* found */ @@ -372,7 +372,7 @@ void ME_UnselectStyleFont(ME_TextEditor *editor, HDC hDC, ME_Style *s, HFONT hOl assert(0 == "UnselectStyleFont without SelectStyleFont"); } -void ME_DestroyStyle(ME_Style *s) { +static void ME_DestroyStyle(ME_Style *s) { if (s->hFont) { DeleteObject(s->hFont);