diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-10-31 17:51:46 +0100 |
---|---|---|
committer | Tobias Madl <tobias.madl.dev@gmail.com> | 2014-12-09 12:35:01 +0000 |
commit | 9cc2a28323e2c7209e3dae8ec52fc685215e9357 (patch) | |
tree | 001d82d746525e200358efd9e38e05cf3802dbc2 | |
parent | ec5851361bcf636c57691988b669d76313762a8c (diff) |
framework: avoid double-free in ToolBarManager()
The timer could run after the ToolBarManager is deleted because the
dispose() method can accidentally restart the timer somehow.
Change-Id: I86868f08f436976761e814d4cea1cd5a0e348935
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 431f13eac86c..c9665323a1cc 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -476,7 +476,9 @@ throw ( RuntimeException, std::exception ) { SolarMutexGuard g; if ( Action.Action == FrameAction_CONTEXT_CHANGED ) + { m_aAsyncUpdateControllersTimer.Start(); + } } void SAL_CALL ToolBarManager::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) @@ -1414,7 +1416,9 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine if( m_pToolBar->WillUsePopupMode() ) UpdateControllers(); else if ( m_pToolBar->IsReallyVisible() ) + { m_aAsyncUpdateControllersTimer.Start(); + } // Try to retrieve UIName from the container property set and set it as the title // if it is not empty. @@ -2048,7 +2052,9 @@ IMPL_LINK( ToolBarManager, StateChanged, StateChangedType*, pStateChangedType ) else if ( *pStateChangedType == StateChangedType::VISIBLE ) { if ( m_pToolBar->IsReallyVisible() ) + { m_aAsyncUpdateControllersTimer.Start(); + } } else if ( *pStateChangedType == StateChangedType::INITSHOW ) { |