From c44a445031a12f6c6e51fcff620d8a3cc94a8c7b Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Sun, 14 Feb 2016 16:41:02 -0400 Subject: 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 Reviewed-by: Miklos Vajna --- desktop/source/lib/init.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'desktop') 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(pThis); gImpl = nullptr; SAL_INFO("lok", "LO Destroy"); comphelper::LibreOfficeKit::setStatusIndicatorCallback(nullptr, nullptr); + uno::Reference 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); -- cgit