Browse Source

* Fix 30181: correctly finalize fontmanager

git-svn-id: trunk@33778 -
michael 9 years ago
parent
commit
73ab7d877a
1 changed files with 2 additions and 3 deletions
  1. 2 3
      packages/fcl-image/src/ftfont.pp

+ 2 - 3
packages/fcl-image/src/ftfont.pp

@@ -59,7 +59,7 @@ type
   end;
   end;
 
 
 var
 var
-  FontMgr : TFontManager;
+  FontMgr : TFontManager = nil;
 
 
 procedure InitEngine;
 procedure InitEngine;
 procedure DoneEngine;
 procedure DoneEngine;
@@ -78,8 +78,7 @@ end;
 
 
 procedure DoneEngine;
 procedure DoneEngine;
 begin
 begin
-  if assigned (FontMgr) then
-    FontMgr.Free;
+  FreeAndNil(FontMgr);
 end;
 end;
 
 
 constructor TFreeTypeFont.Create;
 constructor TFreeTypeFont.Create;