diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-12-16 21:27:29 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-12-17 11:43:46 +0100 |
commit | 2f9360b58a358fefb86f474464e53f1ea5ffb52b (patch) | |
tree | 422670f7cc8d3e6ab9674f688d57291076966d37 /sw | |
parent | 696bc1e951e785e71de74d61eeafd06c3e8a0283 (diff) |
Related tdf#114455: fix mem leak on olmenu (sw)
Change-Id: If1da0b1c1dab15694bd741e1827c6a6edf5c46e9
Reviewed-on: https://gerrit.libreoffice.org/46613
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/lingu/olmenu.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index 879a2c93f5c2..f13b5f1e8247 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -600,6 +600,7 @@ void SwSpellPopup::checkRedline() { aSet.Put(SfxVoidItem(nWhich)); } + m_pSh->GetView().GetState(aSet); // Enable/disable items based on if the which id of the void items are @@ -615,7 +616,11 @@ void SwSpellPopup::checkRedline() nId = m_nRedlineNextId; else if (nWhich == FN_REDLINE_PREV_CHANGE) nId = m_nRedlinePrevId; - m_xPopupMenu->EnableItem(nId, aSet.Get(nWhich).Which()); + auto valueWhich = aSet.Get(nWhich).Which(); + m_xPopupMenu->EnableItem(nId, valueWhich); + // Remove the value when we disable item to avoid mem leak + if (!valueWhich) + aSet.ClearItem(nWhich); } } |