diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-10-13 14:29:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-10-13 16:57:47 +0200 |
commit | 5c18404e5dcba62c7415746b0872ae0b22fb0de4 (patch) | |
tree | adc3c85406f8101b235c6b1077b79412e41a30ce /xmloff | |
parent | abe3af8e9871907aa75b913f2b8094cac651bc6d (diff) |
ofz#3635: fix leak
Change-Id: I8656b09db63c85104d60145e63591de916715e53
Reviewed-on: https://gerrit.libreoffice.org/43369
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
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(); } |