summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-09-09 00:47:20 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-09-09 19:37:17 +0200
commite40ba034fa01cc271ad0e1940f623e551793f80b (patch)
treeb110c40ea323319698f48d6f4ee536efca9cd736
parent7ed6bcc714ed0e4f23031c1cbc16176b3549e391 (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>
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index dc5ccfee8339..fb7dd79a2422 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3237,7 +3237,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();
@@ -3347,6 +3346,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();