[HarfBuzz] [patch] leak in Core Text backend

Jonathan Kew jfkthame at googlemail.com
Tue Jul 30 05:18:56 PDT 2013


I noticed today that the Core Text backend leaks atrociously, because it 
fails to release the CTLine object (and hence all the other objects the 
line holds references to). No big deal when testing one-off strings, 
obviously, but if you try tests with a large number of text runs it gets 
really out of hand!

Trivial patch attached.

JK


-------------- next part --------------
commit 18f86a7d957d83f845ab54003b7cf6e181669c72
Author: Jonathan Kew <jfkthame at gmail.com>
Date:   Tue Jul 30 13:09:53 2013 +0100

    [CoreText] Don't leak the CTLine object (and everything that hangs off it)

diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index 66db97b..e99a905 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -348,5 +348,7 @@ _hb_coretext_shape (hb_shape_plan_t    *shape_plan,
     }
   }
 
+  CFRelease (line);
+
   return true;
 }


More information about the HarfBuzz mailing list