summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-26 09:57:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-26 10:01:14 +0200
commit642ae256ea5b8083ba0b3c097ca8ea52304b9cdb (patch)
tree1b2f3a1df38e52e2a1c9a3c6e5a54f956a76be23 /sfx2/source
parentdbcc169d8c1008d46f62e0a526aa89331471621a (diff)
ChangedUIEventListener is refcounted, mustn't be helt by unique_ptr
Fixes c0ce1ec3736be861a2ed58827fadb25269ab0117 "loplugin:unusedfields in sfx2 part1" part on "fix a memory leak in NotebookbarTabControl where it was not freeing it's m_pListener field", which now caused ASan to report heap-use-after- free during CppunitTest_sw_dialogs_test. Change-Id: Ic0209650692a34abd1ee451713615a03ed9c746f
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/notebookbar/NotebookbarTabControl.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
index 9bf86aa6d505..fbff4b02661f 100644
--- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx
+++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
@@ -130,7 +130,6 @@ public:
NotebookbarTabControl::NotebookbarTabControl( Window* pParent )
: NotebookbarTabControlBase( pParent )
-, m_pListener( nullptr )
, m_bInitialized( false )
, m_bInvalidate( true )
{
@@ -150,7 +149,7 @@ void NotebookbarTabControl::StateChanged(StateChangedType nStateChange)
SetToolBox( static_cast<ToolBox*>( pShortcuts.get() ) );
SetIconClickHdl( LINK( this, NotebookbarTabControl, OpenNotebookbarPopupMenu ) );
- m_pListener.reset( new ChangedUIEventListener( this ) );
+ m_pListener = new ChangedUIEventListener( this );
m_bInitialized = true;
}