[Libreoffice-commits] core.git: xmloff/source
Caolán McNamara
caolanm at redhat.com
Fri Oct 13 14:58:07 UTC 2017
xmloff/source/core/xmlimp.cxx | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit 5c18404e5dcba62c7415746b0872ae0b22fb0de4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 13 14:29:29 2017 +0100
ofz#3635: fix leak
Change-Id: I8656b09db63c85104d60145e63591de916715e53
Reviewed-on: https://gerrit.libreoffice.org/43369
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index a4635551c622..16ed180351e9 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -414,8 +414,18 @@ void SvXMLImport::cleanup() throw ()
mxModel->removeEventListener(mxEventListener);
// clear context stacks first in case of parse error because the context
// class dtors are full of application logic
- while (!maFastContexts.empty()) { maFastContexts.pop(); }
- while (!maContexts.empty()) { maContexts.pop(); }
+ while (!maFastContexts.empty())
+ {
+ if (SvXMLStylesContext* pStylesContext = dynamic_cast<SvXMLStylesContext*>(maFastContexts.top().get()))
+ pStylesContext->Clear();
+ maFastContexts.pop();
+ }
+ while (!maContexts.empty())
+ {
+ if (SvXMLStylesContext* pStylesContext = dynamic_cast<SvXMLStylesContext*>(maContexts.top().get()))
+ pStylesContext->Clear();
+ maContexts.pop();
+ }
DisposingModel();
}
More information about the Libreoffice-commits
mailing list