From 766e109fd638ef1eac33717b52e04a351da46483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 14 Dec 2014 12:57:21 +0100 Subject: Imported Upstream version 5.9.6 --- enc/unicode.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'enc/unicode.c') 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 + * Copyright (c) 2002-2013 K.Kosako * 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; -- cgit v1.2.3