freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 139443663: Move generic destroy to later in the face


From: Werner Lemberg
Subject: [freetype2] master 139443663: Move generic destroy to later in the face and size destruction.
Date: Tue, 15 Oct 2024 23:11:38 -0400 (EDT)

branch: master
commit 139443663368617b30b70cf6912e9577ecbb845f
Author: Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org>
Commit: Werner Lemberg <wl@gnu.org>

    Move generic destroy to later in the face and size destruction.
    
    * src/base/ftobjs.c (destroy_size, destroy_face): This is such that the
      generic destroy can be used to call `FT_Done_Library`.  For that to work,
      it needs to call it *after* having removed the face from the respective
      module.
---
 src/base/ftobjs.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 9b97820c3..720a3f4b6 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1253,14 +1253,14 @@
     FT_Driver  driver = (FT_Driver)driver_;
 
 
-    /* finalize client-specific data */
-    if ( size->generic.finalizer )
-      size->generic.finalizer( size );
-
     /* finalize format-specific stuff */
     if ( driver->clazz->done_size )
       driver->clazz->done_size( size );
 
+    /* finalize client-specific data */
+    if ( size->generic.finalizer )
+      size->generic.finalizer( size );
+
     FT_FREE( size->internal );
     FT_FREE( size );
   }
@@ -1322,10 +1322,6 @@
                       driver );
     face->size = NULL;
 
-    /* now discard client data */
-    if ( face->generic.finalizer )
-      face->generic.finalizer( face );
-
     /* discard charmaps */
     destroy_charmaps( face, memory );
 
@@ -1340,6 +1336,10 @@
 
     face->stream = NULL;
 
+    /* now discard client data */
+    if ( face->generic.finalizer )
+      face->generic.finalizer( face );
+
     /* get rid of it */
     if ( face->internal )
     {



reply via email to

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