summaryrefslogtreecommitdiff
path: root/enc
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-12-14 12:57:21 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-12-14 12:57:21 +0100
commit766e109fd638ef1eac33717b52e04a351da46483 (patch)
treec8bbecdc1d0d5d3e4bd89bcb28306597af9a1312 /enc
parent0dbf3761f6b98e5c16c9bfa0306ae5d3257d081f (diff)
Imported Upstream version 5.9.6upstream/5.9.6
Diffstat (limited to 'enc')
-rw-r--r--enc/unicode.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/enc/unicode.c b/enc/unicode.c
index af7a86e..e13429f 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -2,7 +2,7 @@
unicode.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10891,6 +10891,21 @@ static st_table* Unfold2Table;
static st_table* Unfold3Table;
static int CaseFoldInited = 0;
+
+extern void onigenc_end_unicode(void)
+{
+ THREAD_ATOMIC_START;
+
+ if (FoldTable != 0) st_free_table(FoldTable);
+ if (Unfold1Table != 0) st_free_table(Unfold1Table);
+ if (Unfold2Table != 0) st_free_table(Unfold2Table);
+ if (Unfold3Table != 0) st_free_table(Unfold3Table);
+
+ CaseFoldInited = 0;
+
+ THREAD_ATOMIC_END;
+}
+
static int init_case_fold_table(void)
{
const CaseFold_11_Type *p;
@@ -10952,6 +10967,9 @@ static int init_case_fold_table(void)
st_add_direct(Unfold3Table, (st_data_t )p3->from, (st_data_t )(&p3->to));
}
+
+ onig_add_end_call(onigenc_end_unicode);
+
CaseFoldInited = 1;
THREAD_ATOMIC_END;
return 0;