diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2010-08-22 13:45:56 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2010-08-22 13:45:56 +0200 |
commit | 45f44897e3de7020e8161ebef212774f9080ebeb (patch) | |
tree | a39623bb208515d8cfdf65ab8946ba2be8c2003b | |
parent | befeb59842e35999816429ddc55472259e401061 (diff) | |
download | fpGUI-45f44897e3de7020e8161ebef212774f9080ebeb.tar.xz |
docview: fixes the AV on exit.
NOTE
This is not a 100% fix, but rather a work-around. I need to still find out
why such AV's occur.
-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; |