summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-10 10:30:58 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-10 11:34:25 +0200
commit47e6ec0736aa129e181e0b6f02cec884f9832432 (patch)
treededf3d6a54ee43baab89880b4adb21dd7342eef8
parentcbfdec66033d14020d3e8a49bacc0d12d2b6798e (diff)
Avoid trying to load libthai again and again if it's not present
Change-Id: I3bcbde7bbb307fb27c36709c33c8ff5cd09ab7f8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-thai.c4
1 files changed, 3 insertions, 1 deletions
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;