aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
authorZufu Liu <unknown>2024-05-06 14:48:38 +1000
committerZufu Liu <unknown>2024-05-06 14:48:38 +1000
commitd61d88dbd8e5d8a12cd488c9437c5aa9ebcc0471 (patch)
tree6a418bbcb53c627efb685719d843babc67d19a24 /win32/PlatWin.cxx
parent371f23c5746dfa85c48f654c4bd273135799dab8 (diff)
downloadscintilla-mirror-d61d88dbd8e5d8a12cd488c9437c5aa9ebcc0471.tar.gz
Make LoadD2D noexcept so can be called in more situations.
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index c3c6b609a..144077b95 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -124,9 +124,13 @@ void LoadD2DOnce() noexcept {
}
}
-bool LoadD2D() {
+bool LoadD2D() noexcept {
static std::once_flag once;
- std::call_once(once, LoadD2DOnce);
+ try {
+ std::call_once(once, LoadD2DOnce);
+ } catch (...) {
+ // ignore
+ }
return pIDWriteFactory && pD2DFactory;
}