summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-02-16 21:21:24 -0400
committerHenry Castro <hcastro@collabora.com>2016-02-16 21:21:24 -0400
commit4fff20024952c19b141f3c34c79ff9d116442fbc (patch)
tree9e47d8bbd043dabbab51ad9843e3945389ece6e1 /desktop
parent2cee81ff8d5e16bd912ba25abfd785d7f3745f38 (diff)
lok: add desktop terminate
When lokit is destroyed, the Desktop service is still alive. So in order to avoid debug assertion "Desktop disposed before terminating it", terminate to quit application. Change-Id: Id1391cde516915d915e5321799436e92b444e935 Reviewed-on: https://gerrit.libreoffice.org/22359 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 16d0c130fed7..520b8adcbd4c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2010,14 +2010,26 @@ LibreOfficeKit *libreofficekit_hook(const char* install_path)
static void lo_destroy(LibreOfficeKit* pThis)
{
+ bool bSuccess = false;
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
gImpl = NULL;
SAL_INFO("lok", "LO Destroy");
comphelper::LibreOfficeKit::setStatusIndicatorCallback(0, 0);
+ uno::Reference <frame::XDesktop2> xDesktop = frame::Desktop::create ( ::comphelper::getProcessComponentContext() );
+ bSuccess = xDesktop.is() && xDesktop->terminate();
+
+ if (!bSuccess)
+ {
+ bSuccess = GetpApp() && GetpApp()->QueryExit();
+ }
+
+ if (!bSuccess)
+ {
+ Application::Quit();
+ }
- Application::Quit();
osl_joinWithThread(pLib->maThread);
osl_destroyThread(pLib->maThread);