From 47e6ec0736aa129e181e0b6f02cec884f9832432 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 10 May 2012 10:30:58 +0200 Subject: Avoid trying to load libthai again and again if it's not present Change-Id: I3bcbde7bbb307fb27c36709c33c8ff5cd09ab7f8 Reviewed-by: Lars Knoll --- src/3rdparty/harfbuzz/src/harfbuzz-thai.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/3rdparty/harfbuzz') diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c index 3c0ffe8358..039394a5a2 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c @@ -53,12 +53,14 @@ static th_render_cell_win_def th_render_cell_win = 0; static th_render_cell_mac_def th_render_cell_mac = 0; static int init_libthai() { - if (!th_brk || !th_next_cell || !th_render_cell_tis || !th_render_cell_win || !th_render_cell_mac) { + static HB_Bool initialized = false; + if (!initialized && (!th_brk || !th_next_cell || !th_render_cell_tis || !th_render_cell_win || !th_render_cell_mac)) { th_brk = (th_brk_def) HB_Library_Resolve("thai", (int)LIBTHAI_MAJOR, "th_brk"); th_next_cell = (th_next_cell_def)HB_Library_Resolve("thai", LIBTHAI_MAJOR, "th_next_cell"); th_render_cell_tis = (th_render_cell_tis_def) HB_Library_Resolve("thai", (int)LIBTHAI_MAJOR, "th_render_cell_tis"); th_render_cell_win = (th_render_cell_win_def) HB_Library_Resolve("thai", (int)LIBTHAI_MAJOR, "th_render_cell_win"); th_render_cell_mac = (th_render_cell_mac_def) HB_Library_Resolve("thai", (int)LIBTHAI_MAJOR, "th_render_cell_mac"); + initialized = true; } if (th_brk && th_next_cell && th_render_cell_tis && th_render_cell_win && th_render_cell_mac) return 1; -- cgit v1.2.3