]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/samples/layout/FontTableCache.cpp
ICU-62108.0.1.tar.gz
[apple/icu.git] / icuSources / samples / layout / FontTableCache.cpp
index 75130ff3af13ef36f016777b9214004c3e77bfec..7ca68b761cd1a659c5604544c72914f9aac80dc3 100644 (file)
@@ -1,8 +1,12 @@
 /*
- **********************************************************************
- *   Copyright (C) 2003, International Business Machines
+ *************************************************************************
+ *   © 2016 and later: Unicode, Inc. and others.
+ *   License & terms of use: http://www.unicode.org/copyright.html#License
+ *************************************************************************
+ *************************************************************************
+ *   Copyright (C) 2003 - 2008, International Business Machines
  *   Corporation and others.  All Rights Reserved.
- **********************************************************************
+ *************************************************************************
  */
 
 #include "layout/LETypes.h"
@@ -37,7 +41,7 @@ FontTableCache::FontTableCache()
 FontTableCache::~FontTableCache()
 {
     for (int i = fTableCacheCurr - 1; i >= 0; i -= 1) {
-        LE_DELETE_ARRAY(fTableCache[i].table);
+        freeFontTable(fTableCache[i].table);
 
         fTableCache[i].tag   = 0;
         fTableCache[i].table = NULL;
@@ -49,6 +53,11 @@ FontTableCache::~FontTableCache()
     fTableCache = NULL;
 }
 
+void FontTableCache::freeFontTable(const void *table) const
+{
+    LE_DELETE_ARRAY(table);
+}
+
 const void *FontTableCache::find(LETag tableTag) const
 {
     for (int i = 0; i < fTableCacheCurr; i += 1) {