freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] ftbench-gsoc-goksu b3ab39d 11/17: * src/ftbench.c (mai


From: Werner Lemberg
Subject: [freetype2-demos] ftbench-gsoc-goksu b3ab39d 11/17: * src/ftbench.c (main): Assure cache setup, clean exit.
Date: Sat, 20 May 2023 08:29:43 -0400 (EDT)

branch: ftbench-gsoc-goksu
commit b3ab39d74ad7e0ec7136bb0a09ad5cc39ca732b4
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/ftbench.c (main): Assure cache setup, clean exit.
---
 src/ftbench.c | 33 ++++++++++-----------------------
 1 file changed, 10 insertions(+), 23 deletions(-)

diff --git a/src/ftbench.c b/src/ftbench.c
index 2ef9e9b..8e415d0 100644
--- a/src/ftbench.c
+++ b/src/ftbench.c
@@ -1359,13 +1359,14 @@
       }
     }
 
-    FTC_Manager_New( lib,
-                     0,
-                     0,
-                     max_bytes,
-                     face_requester,
-                     NULL,
-                     &cache_man );
+    if ( FTC_Manager_New( lib,
+                          0,
+                          0,
+                          max_bytes,
+                          face_requester,
+                          NULL,
+                          &cache_man ) )
+      compare_cached = 0;
 
     font_type.face_id = (FTC_FaceID)1;
     font_type.width   = size;
@@ -1550,25 +1551,11 @@
       }
     }
 
-  Exit:
-    /* The following is a bit subtle: When we call FTC_Manager_Done, this
-     * normally destroys all FT_Face objects that the cache might have
-     * created by calling the face requester.
-     *
-     * However, this little benchmark uses a tricky face requester that
-     * doesn't create a new FT_Face through FT_New_Face but simply passes a
-     * pointer to the one that was previously created.
-     *
-     * If the cache manager has been used before, the call to
-     * FTC_Manager_Done discards our single FT_Face.
-     *
-     * In the case where no cache manager is in place, or if no test was
-     * run, the call to FT_Done_FreeType releases any remaining FT_Face
-     * object anyway.
-     */
     if ( cache_man )
       FTC_Manager_Done( cache_man );
 
+  Exit:
+    /* releases any remaining FT_Face object too */
     FT_Done_FreeType( lib );
 
     return 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]