FT_Done_Library() private method

private FT_Done_Library ( IntPtr library ) : System.Error
library System.IntPtr
return System.Error
Example #1
0
        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                disposed = true;

                //dipose all the children before disposing the library.
                foreach (Face f in childFaces)
                {
                    f.Dispose();
                }

                foreach (Glyph g in childGlyphs)
                {
                    g.Dispose();
                }

                foreach (Outline o in childOutlines)
                {
                    o.Dispose();
                }

                foreach (Stroker s in childStrokers)
                {
                    s.Dispose();
                }

                foreach (Manager m in childManagers)
                {
                    m.Dispose();
                }

                childFaces.Clear();
                childGlyphs.Clear();
                childOutlines.Clear();
                childStrokers.Clear();
                childManagers.Clear();

                Error err = customMemory ? FT.FT_Done_Library(reference) : FT.FT_Done_FreeType(reference);

                if (err != Error.Ok)
                {
                    throw new FreeTypeException(err);
                }

                reference = IntPtr.Zero;
            }
        }