summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2023-12-15 14:40:53 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2023-12-16 10:54:01 +0100
commit62a50239e06ac2f94f4a1cfbef5a8689bd42b875 (patch)
tree88d526652bf4020641fdd298d63c6d00ac1b44bb /desktop
parentb03aa9647c860af7948f219ed9a0e90e5eb374d5 (diff)
Avoid "Desktop disposed before terminating it" assert
...from Desktop::disposing() at framework/source/services/desktop.cxx:1041, on Windows, when the HAVE_FEATURE_UPDATE_MAR update() call returns true (and soffice.bin is about to exit now), but the css.frame.Desktop service happens to already have been created somewhere else (and will thus be disposed as part of disposing the service manager) but doesn't receive a terminate() call in Desktop::Main(). So reorder the code in Desktop::Main(), moving the HAVE_FEATURE_UPDATE_MAR code after the > xDesktop = css::frame::Desktop::create( xContext ); so that we have something to call > xDesktop->terminate(); on in this scenario. Change-Id: Iee5b6eeece33d5a27cadb94a7da0d26aa1492e91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160831 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> (cherry picked from commit 98caf4786033da6c39b4f746d79ab4f340683d32) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160850
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/app.cxx35
1 files changed, 19 insertions, 16 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 4c13a2a8e716..8136d39a9806 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1351,6 +1351,22 @@ int Desktop::Main()
if ( !InitializeConfiguration() )
return EXIT_FAILURE;
+ SetSplashScreenProgress(30);
+
+ // create title string
+ OUString aTitle(ReplaceStringHookProc(RID_APPTITLE));
+#ifdef DBG_UTIL
+ //include buildid in non product builds
+ aTitle += " [" + utl::Bootstrap::getBuildIdData("development") + "]";
+#endif
+
+ SetDisplayName( aTitle );
+ SetSplashScreenProgress(35);
+ pExecGlobals->pPathOptions.reset( new SvtPathOptions);
+ SetSplashScreenProgress(40);
+
+ xDesktop = css::frame::Desktop::create( xContext );
+
#if HAVE_FEATURE_UPDATE_MAR
const char* pUpdaterTestEnable = std::getenv("LIBO_UPDATER_TEST_ENABLE");
if (pUpdaterTestEnable || officecfg::Office::Update::Update::Enabled::get())
@@ -1414,7 +1430,10 @@ int Desktop::Main()
CloseSplashScreen();
bool bSuccess = update();
if (bSuccess)
+ {
+ xDesktop->terminate();
return EXIT_SUCCESS;
+ }
}
else if (isTimeForUpdateCheck() || pForcedUpdateCheck)
{
@@ -1429,22 +1448,6 @@ int Desktop::Main()
}
#endif
- SetSplashScreenProgress(30);
-
- // create title string
- OUString aTitle(ReplaceStringHookProc(RID_APPTITLE));
-#ifdef DBG_UTIL
- //include buildid in non product builds
- aTitle += " [" + utl::Bootstrap::getBuildIdData("development") + "]";
-#endif
-
- SetDisplayName( aTitle );
- SetSplashScreenProgress(35);
- pExecGlobals->pPathOptions.reset( new SvtPathOptions);
- SetSplashScreenProgress(40);
-
- xDesktop = css::frame::Desktop::create( xContext );
-
// create service for loading SFX (still needed in startup)
pExecGlobals->xGlobalBroadcaster = Reference < css::document::XDocumentEventListener >
( css::frame::theGlobalEventBroadcaster::get(xContext), UNO_SET_THROW );