diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-09-09 00:47:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-15 12:46:18 +0200 |
commit | 61d85c4e7c30ea0f5242d927b7456190020b4fbe (patch) | |
tree | 7d7417e131ca766e0fd925604476d318cf49c5fa | |
parent | 4f269f8c8965be157e0584ead84a65347d8b6b69 (diff) |
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@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit e40ba034fa01cc271ad0e1940f623e551793f80b)
Reviewed-on: https://gerrit.libreoffice.org/42138
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
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(); |