summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/app/salinst.cxx1
-rw-r--r--vcl/win/gdi/winlayout.cxx26
2 files changed, 17 insertions, 10 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 94ae96d53608..da67ca44582f 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -39,6 +39,7 @@
#include "win/salobj.h"
#include "win/saltimer.h"
#include "win/salbmp.h"
+#include "win/winlayout.hxx"
#include "salimestatus.hxx"
#include "salsys.hxx"
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 482cbd7a460c..22a6fb268f55 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -3072,20 +3072,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;
}