From fa7708def7601bd07cb7642dc444993d7f8f8587 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 26 Nov 2015 11:32:40 +0000 Subject: mutex used in post-main dtor Change-Id: Ia4f4def1fd58d82a7c994114e45a36227269671c --- vcl/source/app/svmain.cxx | 7 +++++++ vcl/source/helper/commandinfoprovider.cxx | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'vcl/source') diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 9cb3d2de7035..ce44f6003387 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -38,6 +38,7 @@ #include "vcl/implimagetree.hxx" #include "vcl/settings.hxx" #include "vcl/unowrap.hxx" +#include "vcl/commandinfoprovider.hxx" #include "vcl/configsettings.hxx" #include "vcl/lazydelete.hxx" #include "vcl/embeddedfontshelper.hxx" @@ -517,6 +518,12 @@ void DeInitVCL() if (pSVData->mpBlendFrameCache) delete pSVData->mpBlendFrameCache, pSVData->mpBlendFrameCache = nullptr; + if (pSVData->mpCommandInfoProvider) + { + pSVData->mpCommandInfoProvider->dispose(); + pSVData->mpCommandInfoProvider = nullptr; + } + ImplDeletePrnQueueList(); delete pSVData->maGDIData.mpScreenFontList; pSVData->maGDIData.mpScreenFontList = nullptr; diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 5ef6f099bd5b..fcc8aecb9764 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -31,6 +31,8 @@ #include #include +#include "svdata.hxx" + using namespace css; using namespace css::uno; @@ -100,15 +102,26 @@ CommandInfoProvider::CommandInfoProvider() msCachedModuleIdentifier(), mxFrameListener() { + ImplGetSVData()->mpCommandInfoProvider = this; } -CommandInfoProvider::~CommandInfoProvider() +void CommandInfoProvider::dispose() { if (mxFrameListener.is()) { mxFrameListener->dispose(); - mxFrameListener = nullptr; + mxFrameListener.clear(); } + mxCachedGlobalAcceleratorConfiguration.clear(); + mxCachedModuleAcceleratorConfiguration.clear(); + mxCachedDocumentAcceleratorConfiguration.clear(); + mxCachedDataFrame.clear(); + mxContext.clear(); +} + +CommandInfoProvider::~CommandInfoProvider() +{ + dispose(); } OUString CommandInfoProvider::GetLabelForCommand ( -- cgit