Ignore:
Timestamp:
Jul 1, 2008, 6:43:38 PM (13 years ago)
Author:
Eugene Romanenko
Message:

PDF plugin: Poppler library updated to version 0.8.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/poppler/mypoppler/poppler/CairoOutputDev.cc

    r250 r253  
    7575//------------------------------------------------------------------------
    7676
     77// We cannot tie the lifetime of an FT_Library object to that of
     78// CairoOutputDev, since any FT_Faces created with it may end up with a
     79// reference by Cairo which can be held long after the CairoOutputDev is
     80// deleted.  The simplest way to avoid problems is to never tear down the
     81// FT_Library instance; to avoid leaks, just use a single global instance
     82// initialized the first time it is needed.
     83FT_Library CairoOutputDev::ft_lib;
     84GBool CairoOutputDev::ft_lib_initialized = gFalse;
     85
    7786CairoOutputDev::CairoOutputDev() {
    7887  xref = NULL;
    7988
    80   FT_Init_FreeType(&ft_lib);
     89  if (!ft_lib_initialized) {
     90    FT_Init_FreeType(&ft_lib);
     91    ft_lib_initialized = gTrue;
     92  }
     93
    8194  fontEngine = NULL;
    8295  glyphs = NULL;
     
    103116    delete fontEngine;
    104117  }
    105   FT_Done_FreeType(ft_lib);
    106  
     118
    107119  if (cairo)
    108120    cairo_destroy (cairo);
Note: See TracChangeset for help on using the changeset viewer.