sw/source/uibase/lingu/olmenu.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 2f9360b58a358fefb86f474464e53f1ea5ffb52b Author: Julien Nabet <serval2...@yahoo.fr> Date: Sat Dec 16 21:27:29 2017 +0100 Related tdf#114455: fix mem leak on olmenu (sw) Change-Id: If1da0b1c1dab15694bd741e1827c6a6edf5c46e9 Reviewed-on: https://gerrit.libreoffice.org/46613 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits