Skip to content

Commit 14f43d3

Browse files
committed
Don't call ICU's u_init/u_shutdown
Doing so is not necessary with modern ICU versions and because we use system-provided ICU, u_cleanup() can (and does, on macOS 26) lead to crashes during shutdown. See https://unicode-org.github.io/icu/userguide/icu4c/
1 parent de8f7d6 commit 14f43d3

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

src/edapp.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,6 @@ int PoeditApp::OnExit()
532532

533533
dispatch::cleanup();
534534

535-
u_cleanup();
536-
537535
return wxApp::OnExit();
538536
}
539537

src/quicklook/GeneratePreviewForURL.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ extern "C"
8181

8282
void Initialize_plugin(void)
8383
{
84-
UErrorCode err = U_ZERO_ERROR;
85-
u_init(&err);
86-
8784
wxInitialize();
8885

8986
CFBundleRef bundle = CFBundleGetBundleWithIdentifier(CFSTR("net.poedit.PoeditQuicklook"));
@@ -101,6 +98,8 @@ void Initialize_plugin(void)
10198

10299
wxString bestTrans = trans->GetBestTranslation("poedit-quicklook");
103100
Language uiLang = Language::TryParse(bestTrans.ToStdWstring());
101+
102+
UErrorCode err = U_ZERO_ERROR;
104103
uloc_setDefault(uiLang.IcuLocaleName().c_str(), &err);
105104
}
106105
CFRelease(url);
@@ -110,7 +109,6 @@ void Initialize_plugin(void)
110109
void Uninitialize_plugin(void)
111110
{
112111
wxUninitialize();
113-
u_cleanup();
114112
}
115113

116114

src/quicklook/PreviewProvider.mm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151

5252
void initialize_extension()
5353
{
54-
UErrorCode err = U_ZERO_ERROR;
55-
u_init(&err);
56-
5754
wxInitialize();
5855

5956
auto resources = str::to_wx(NSBundle.mainBundle.resourcePath);
@@ -65,13 +62,14 @@ void initialize_extension()
6562

6663
wxString bestTrans = trans->GetBestTranslation("poedit-quicklook");
6764
Language uiLang = Language::TryParse(bestTrans.ToStdWstring());
65+
66+
UErrorCode err = U_ZERO_ERROR;
6867
uloc_setDefault(uiLang.IcuLocaleName().c_str(), &err);
6968
}
7069

7170
void cleanup_extension()
7271
{
7372
wxUninitialize();
74-
u_cleanup();
7573
}
7674

7775
NSData *create_html_preview(const wxString& filename)

0 commit comments

Comments
 (0)