diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/PlatWin.cxx | 8 | ||||
-rw-r--r-- | win32/PlatWin.h | 2 |
2 files changed, 7 insertions, 3 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; } diff --git a/win32/PlatWin.h b/win32/PlatWin.h index 70721d4a7..a901ec78d 100644 --- a/win32/PlatWin.h +++ b/win32/PlatWin.h @@ -68,7 +68,7 @@ public: }; #if defined(USE_D2D) -extern bool LoadD2D(); +extern bool LoadD2D() noexcept; extern ID2D1Factory *pD2DFactory; extern IDWriteFactory *pIDWriteFactory; |