summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-02-14 16:41:02 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-16 08:40:48 +0000
commitc44a445031a12f6c6e51fcff620d8a3cc94a8c7b (patch)
tree5d214fa7d8053002244a8514495dc6e15251e714 /desktop
parent980d5225ad485fe76aecdcea010b726b2343ad04 (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 75c17b412ab6..bb480b39f866 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2024,14 +2024,26 @@ int lok_preinit(const char* install_path, const char* user_profile_path)
static void lo_destroy(LibreOfficeKit* pThis)
{
+ bool bSuccess = false;
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
gImpl = nullptr;
SAL_INFO("lok", "LO Destroy");
comphelper::LibreOfficeKit::setStatusIndicatorCallback(nullptr, nullptr);
+ 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);