[FIRE-32453] [BUG-232971] disconnect sooner to force the cache write

The call to forceQuit sets the viewer state to Quitting. This triggers all the thread pools to exit, and to do so with no sense of orderly closure. 
As a result the main window can exit which removes any visual indication to the user that work is still happening. 
When the user then restarts, issues are caused because of temporary files that may still be in use.
It is possible too that the early closure of the mainwindow, allows the OS to terminate the process without prompting the user for a safe shutdown (unproven)
master
Beq 2022-11-27 23:01:42 +00:00
parent 026b8ff411
commit 69a31fad4c
1 changed files with 18 additions and 7 deletions

View File

@ -2057,12 +2057,12 @@ bool LLAppViewer::cleanup()
// Give any remaining SLPlugin instances a chance to exit cleanly.
LLPluginProcessParent::shutdown();
// <FS:Beq> [FIRE-32453] [BUG-232971] disconnect sooner to force the cache write.
// disconnectViewer();
// LLViewerCamera::deleteSingleton();
disconnectViewer();
LLViewerCamera::deleteSingleton();
LL_INFOS() << "Viewer disconnected" << LL_ENDL;
// LL_INFOS() << "Viewer disconnected" << LL_ENDL;
// </FS:Beq>
if (gKeyboard)
{
gKeyboard->resetKeys();
@ -4864,6 +4864,11 @@ void LLAppViewer::removeDumpDir()
void LLAppViewer::forceQuit()
{
// <FS:Beq> [FIRE-32453] [BUG-232971] disconnect sooner to force the cache write.
disconnectViewer();
LLViewerCamera::deleteSingleton();
LL_INFOS() << "Viewer disconnected" << LL_ENDL;
// </FS:Beq>
LLApp::setQuitting();
}
@ -6334,7 +6339,12 @@ void LLAppViewer::idleNetwork()
}
}
add(LLStatViewer::NUM_NEW_OBJECTS, gObjectList.mNumNewObjects);
// <FS:Beq> [FIRE-32453] [BUG-232971] disconnect sooner to force the cache write.
if(gDisconnected)
{
return;
}
// </FS:Beq>
// Retransmit unacknowledged packets.
gXferManager->retransmitUnackedPackets();
gAssetStorage->checkForTimeouts();
@ -6363,6 +6373,7 @@ void LLAppViewer::disconnectViewer()
{
return;
}
gDisconnected = TRUE;// <FS:Beq> [FIRE-32453] [BUG-232971] disconnect sooner to force the cache write.
//
// Cleanup after quitting.
//
@ -6445,7 +6456,7 @@ void LLAppViewer::disconnectViewer()
LLDestroyClassList::instance().fireCallbacks();
cleanup_xfer_manager();
gDisconnected = TRUE;
// gDisconnected = TRUE; // <FS:Beq/> [FIRE-32453] [BUG-232971] disconnect sooner to force the cache write.
// Pass the connection state to LLUrlEntryParcel not to attempt
// parcel info requests while disconnected.