diff options
Diffstat (limited to 'docview/components/richtext/CanvasFontManager.pas')
-rw-r--r-- | docview/components/richtext/CanvasFontManager.pas | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/docview/components/richtext/CanvasFontManager.pas b/docview/components/richtext/CanvasFontManager.pas index 7996c16d..2994eece 100644 --- a/docview/components/richtext/CanvasFontManager.pas +++ b/docview/components/richtext/CanvasFontManager.pas @@ -567,10 +567,16 @@ begin FCanvas.Font := fpgApplication.DefaultFont; // delete each logical font and our record of it - for i := 0 to FLogicalFonts.Count - 1 do + for i := FLogicalFonts.Count-1 downto 0 do begin - lFont := TLogicalFont(FLogicalFonts[ i ]); - lFont.Free; + // TODO: This must be fixed. If we don't use try..except we sometimes get AV's on lFont.Free + // TODO: TLogicalFont must be totally removed from DocView. + try + lFont := TLogicalFont(FLogicalFonts[i]); + lFont.Free; + except + // do nothing + end; end; FLogicalFonts.Clear; FLogicalFonts.Free; |