Skip to content

Commit 639781b

Browse files
committed
stringrenderer_test: Get system locale only once
This fixes a runtime exception on macOS. Signed-off-by: Stefan Weil <[email protected]>
1 parent bb226c1 commit 639781b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

unittest/stringrenderer_test.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ using tesseract::StringRenderer;
5050

5151
class StringRendererTest : public ::testing::Test {
5252
protected:
53-
void SetUp() {
54-
std::locale::global(std::locale(""));
53+
void SetUp() override {
54+
static std::locale system_locale("");
55+
std::locale::global(system_locale);
5556
}
5657

5758
static void SetUpTestCase() {

0 commit comments

Comments
 (0)