[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source
Julien Nabet
serval2412 at yahoo.fr
Fri Sep 15 10:46:42 UTC 2017
svx/source/tbxctrls/tbcontrl.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 61d85c4e7c30ea0f5242d927b7456190020b4fbe
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sat Sep 9 00:47:20 2017 +0200
tdf#111894: fix leak memory with PaletteManager with SvxColorListBox
m_xColorWindow is made with m_xPaletteManager so reset this last one before disposeAndClear first one
By tracing constructor/destructor of PaletteManager, it seems there's no need
to call m_xColorWindow.disposeAndClear() in SetSlotId.
Change-Id: Ib3c236f8fd7fd12aaa86389f5c4c26fe58ba833e
Reviewed-on: https://gerrit.libreoffice.org/42121
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
Tested-by: Julien Nabet <serval2412 at yahoo.fr>
(cherry picked from commit e40ba034fa01cc271ad0e1940f623e551793f80b)
Reviewed-on: https://gerrit.libreoffice.org/42138
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ea33ee769209..07582e68d56c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3233,7 +3233,6 @@ void SvxColorListBox::SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton)
{
m_nSlotId = nSlotId;
m_bShowNoneButton = bShowNoneButton;
- m_xColorWindow.disposeAndClear();
m_aSelectedColor = bShowNoneButton ? GetNoneColor() : GetAutoColor(m_nSlotId);
ShowPreview(m_aSelectedColor);
createColorWindow();
@@ -3344,6 +3343,11 @@ SvxColorListBox::~SvxColorListBox()
void SvxColorListBox::dispose()
{
+ // TODO: reset should be made automatically but...
+ // tdf#111894: avoid memory leak with PaletteManager with SvxColorListBox
+ // m_xColorWindow is made with m_xPaletteManager
+ // so reset this last one before disposeAndClear first one
+ m_xPaletteManager.reset();
m_xColorWindow.disposeAndClear();
m_aColorWrapper.dispose();
MenuButton::dispose();
More information about the Libreoffice-commits
mailing list