summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-07-13 13:57:30 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-07-13 15:47:46 +0200
commit58aac6e941c0a84e568c14e2aa276c867f725dff (patch)
treed0e41a269ec8c2305f10830d89f0f8220bfbcd7b /framework
parent303c46e2394f6b744f0df5e8e55a8e1cd8e22a91 (diff)
framework, sfx2: catch more exceptions when the object is already disposed
This can happen when an out of process Java object is registered as a callback, then that Java process exits without notifying us. Handle this failure by just ignoring that object, so we don't crash on soffice process shutdown. Change-Id: I5d61e76494c62148ef0c3db24789a5ea6e5843eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118823 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'framework')
-rw-r--r--framework/source/dispatch/interceptionhelper.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx
index 899ce2440946..5287244b677a 100644
--- a/framework/source/dispatch/interceptionhelper.cxx
+++ b/framework/source/dispatch/interceptionhelper.cxx
@@ -20,8 +20,12 @@
#include <dispatch/interceptionhelper.hxx>
#include <com/sun/star/frame/XInterceptorInfo.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <osl/diagnose.h>
#include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
+
+using namespace com::sun::star;
namespace framework{
@@ -185,7 +189,18 @@ void SAL_CALL InterceptionHelper::releaseDispatchProviderInterceptor(const css::
xMasterI->setSlaveDispatchProvider(xSlaveD);
if (xSlaveI.is())
- xSlaveI->setMasterDispatchProvider(xMasterD);
+ {
+ try
+ {
+ xSlaveI->setMasterDispatchProvider(xMasterD);
+ }
+ catch (const lang::DisposedException&)
+ {
+ TOOLS_WARN_EXCEPTION("fwk.dispatch",
+ "InterceptionHelper::releaseDispatchProviderInterceptor: "
+ "xSlaveI is disposed: ");
+ }
+ }
xInterceptor->setSlaveDispatchProvider (css::uno::Reference< css::frame::XDispatchProvider >());
xInterceptor->setMasterDispatchProvider(css::uno::Reference< css::frame::XDispatchProvider >());