diff options
-rw-r--r-- | vcl/source/graphic/Manager.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx index c2146a680e8a..a7359982b9f2 100644 --- a/vcl/source/graphic/Manager.cxx +++ b/vcl/source/graphic/Manager.cxx @@ -72,7 +72,12 @@ Manager::Manager() void Manager::reduceGraphicMemory() { - for (ImpGraphic* pEachImpGraphic : m_pImpGraphicList) + // make a copy of m_pImpGraphicList because if we swap out a svg, the svg + // filter may create more temp Graphics which are auto-added to + // m_pImpGraphicList invalidating a loop over m_pImpGraphicList, e.g. + // reexport of tdf118346-1.odg + auto const aImpGraphicList = m_pImpGraphicList; + for (ImpGraphic* pEachImpGraphic : aImpGraphicList) { if (mnUsedSize < mnMemoryLimit * 0.7) return; |