summaryrefslogtreecommitdiff
path: root/vcl/win/gdi/winlayout.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/win/gdi/winlayout.cxx')
-rw-r--r--vcl/win/gdi/winlayout.cxx26
1 files changed, 16 insertions, 10 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 3f12664b8d96..7c593371790a 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -245,20 +245,26 @@ void D2DWriteTextOutRenderer::CleanupModules()
TextOutRenderer & TextOutRenderer::get(bool bUseDWrite)
{
- if (bUseDWrite)
- {
- static std::unique_ptr<TextOutRenderer> _impl(D2DWriteTextOutRenderer::InitModules()
- ? static_cast<TextOutRenderer*>(new D2DWriteTextOutRenderer())
- : static_cast<TextOutRenderer*>(new ExTextOutRenderer));
+ SalData *const pSalData = GetSalData();
- return *_impl;
+ if (!pSalData)
+ { // don't call this after DeInitVCL()
+ fprintf(stderr, "TextOutRenderer fatal error: no SalData");
+ abort();
}
- else
- {
- static std::unique_ptr<TextOutRenderer> _impl(new ExTextOutRenderer);
- return *_impl;
+ if (!pSalData->m_pTextOutRenderer)
+ {
+ if (bUseDWrite && D2DWriteTextOutRenderer::InitModules())
+ {
+ pSalData->m_pTextOutRenderer.reset(new D2DWriteTextOutRenderer());
+ }
+ else
+ {
+ pSalData->m_pTextOutRenderer.reset(new ExTextOutRenderer());
+ }
}
+ return *pSalData->m_pTextOutRenderer;
}