diff options
-rw-r--r-- | include/vcl/commandinfoprovider.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/svdata.hxx | 7 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 7 | ||||
-rw-r--r-- | vcl/source/helper/commandinfoprovider.cxx | 17 |
4 files changed, 30 insertions, 3 deletions
diff --git a/include/vcl/commandinfoprovider.hxx b/include/vcl/commandinfoprovider.hxx index c790fedacf67..4fc88b733272 100644 --- a/include/vcl/commandinfoprovider.hxx +++ b/include/vcl/commandinfoprovider.hxx @@ -100,6 +100,8 @@ public: */ void SetFrame (const css::uno::Reference<css::frame::XFrame>& rxFrame); + void dispose(); + private: css::uno::Reference<css::uno::XComponentContext> mxContext; css::uno::Reference<css::frame::XFrame> mxCachedDataFrame; diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index da1904c670cc..46527f090f30 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -75,7 +75,11 @@ class Image; class PopupMenu; class Application; class OutputDevice; -namespace vcl { class Window; } +namespace vcl +{ + class CommandInfoProvider; + class Window; +} class SystemWindow; class WorkWindow; class Dialog; @@ -338,6 +342,7 @@ struct ImplSVData VclPtr<vcl::Window> mpIntroWindow; // the splash screen DockingManager* mpDockingManager; BlendFrameCache* mpBlendFrameCache; + vcl::CommandInfoProvider* mpCommandInfoProvider; oslThreadIdentifier mnMainThreadId; rtl::Reference< vcl::DisplayConnection > mxDisplayConnection; 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 <com/sun/star/ui/XImageManager.hpp> #include <com/sun/star/awt/KeyModifier.hpp> +#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 ( |