freetype-devel
[Top][All Lists]
Advanced

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

[Devel] PCF driver memory leaks solved..


From: Niels Moseley
Subject: [Devel] PCF driver memory leaks solved..
Date: Mon, 28 Jan 2002 13:24:21 +0100

I've changed the following to the PCF driver in my own build. Sorry for the non-diff but I don't have a good util. I don't know if this conforms to the Freetype memory freeing strategy but it sure works for me!

Replace the PCF_Done_Face function in pcfdriver.c by:

  FT_LOCAL_DEF FT_Error
  PCF_Done_Face( PCF_Face  face )
  {
    FT_Memory    memory = FT_FACE_MEMORY( face );
    PCF_Property tmp    = face->properties;
    PCF_Toc      toc   =  &face->toc;
    PCF_Table    toctable = face->toc.tables;
    int i;
    unsigned int j;


    FREE( face->encodings );
    FREE( face->metrics );

    for ( i = 0; i < face->nprops; i++ )
    {
      FREE( tmp->name );
      if ( tmp->isString )
        FREE( tmp->value );
      tmp++;
    }
    FREE(face->properties );
    FREE(face->toc.tables);
    FREE(face->root.family_name);
    FREE(face->root.available_sizes);
    FREE(face->charset_encoding);
    FREE(face->charset_registry);

    FT_TRACE4(( "DONE_FACE!!!\n" ));

    return PCF_Err_Ok;
  }




reply via email to

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