Bug 603358 gfxHarfBuzzShaper::InitTextRun leaks hb_font_funcs_create() and hb_unicode_funcs_create(). r=jfkthame a=joe
authortimeless@mozdev.org
Wed, 01 Dec 2010 16:34:24 +0000
changeset 58441 7c282eb45b9b72c1b911f6c10fdb776bd7dda82b
parent 58440 98fa9c0cff7a396517d302c4960211fdddc13aec
child 58442 3e199c023eaf4bbca21690eee72b581e3450753a
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersjfkthame, joe
bugs603358
milestone2.0b8pre
Bug 603358 gfxHarfBuzzShaper::InitTextRun leaks hb_font_funcs_create() and hb_unicode_funcs_create(). r=jfkthame a=joe
gfx/thebes/gfxHarfBuzzShaper.cpp
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -704,25 +704,25 @@ gfxHarfBuzzShaper::InitTextRun(gfxContex
     mFont->SetupCairoFont(aContext);
 
     if (!mHBFace) {
         // set up the harfbuzz face etc the first time we use the font
 
         if (!sHBFontFuncs) {
             // static function callback pointers, initialized by the first
             // harfbuzz shaper used
-            sHBFontFuncs = hb_font_funcs_copy(hb_font_funcs_create());
+            sHBFontFuncs = hb_font_funcs_create();
             hb_font_funcs_set_glyph_func(sHBFontFuncs, HBGetGlyph);
             hb_font_funcs_set_glyph_advance_func(sHBFontFuncs,
                                                  HBGetGlyphAdvance);
             hb_font_funcs_set_contour_point_func(sHBFontFuncs,
                                                  HBGetContourPoint);
             hb_font_funcs_set_kerning_func(sHBFontFuncs, HBGetKerning);
 
-            sHBUnicodeFuncs = hb_unicode_funcs_copy(hb_unicode_funcs_create());
+            sHBUnicodeFuncs = hb_unicode_funcs_create();
             hb_unicode_funcs_set_mirroring_func(sHBUnicodeFuncs,
                                                 HBGetMirroring);
             hb_unicode_funcs_set_script_func(sHBUnicodeFuncs, HBGetScript);
             hb_unicode_funcs_set_general_category_func(sHBUnicodeFuncs,
                                                        HBGetGeneralCategory);
             hb_unicode_funcs_set_combining_class_func(sHBUnicodeFuncs,
                                                       HBGetCombiningClass);
             hb_unicode_funcs_set_eastasian_width_func(sHBUnicodeFuncs,