Revert "Rewrite the inventory corruption fix to reduce possible side-effects"

This reverts commit 5ddbef4a25.
master
Beq 2022-12-17 16:31:16 +00:00
parent 77762929bd
commit d668b30002
2 changed files with 32 additions and 68 deletions

View File

@ -1773,9 +1773,7 @@ bool LLAppViewer::doFrame()
{
LLVoiceClient::getInstance()->terminate();
}
// <FS:Beq> [FIRE-32453] [BUG-232971] disconnect sooner to force the cache write.
persistCachesAndSettings();
// </FS:Beq>
disconnectViewer();
resumeMainloopTimeout();
}
@ -2058,11 +2056,13 @@ 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();
// LL_INFOS() << "Viewer disconnected" << LL_ENDL;
LLViewerCamera::deleteSingleton();
LL_INFOS() << "Viewer disconnected" << LL_ENDL;
// </FS:Beq>
if (gKeyboard)
{
gKeyboard->resetKeys();
@ -4865,7 +4865,8 @@ void LLAppViewer::removeDumpDir()
void LLAppViewer::forceQuit()
{
// <FS:Beq> [FIRE-32453] [BUG-232971] disconnect sooner to force the cache write.
persistCachesAndSettings();
disconnectViewer();
LL_INFOS() << "Viewer disconnected" << LL_ENDL;
// </FS:Beq>
LLApp::setQuitting();
}
@ -6364,48 +6365,14 @@ void LLAppViewer::idleNetwork()
mAgentRegionLastAlive = this_region_alive;
}
}
void LLAppViewer::persistCachesAndSettings()
{
// Save inventory to disk if appropriate
if (gInventory.isInventoryUsable()
&& gAgent.getID().notNull()) // Shouldn't be null at this stage
{
LL_INFOS() << "Saving Inventory Cache" << LL_ENDL;
gInventory.cache(gInventory.getRootFolderID(), gAgent.getID());
if (gInventory.getLibraryRootFolderID().notNull()
&& gInventory.getLibraryOwnerID().notNull())
{
gInventory.cache(
gInventory.getLibraryRootFolderID(),
gInventory.getLibraryOwnerID());
}
LL_INFOS() << "Saving Inventory Cache : COMPLETED" << LL_ENDL;
}
else
{
LL_INFOS() << "Not Saving Inventory Cache : Inventory is currently unusable" << LL_ENDL;
}
// Persist name cache
LLAvatarNameCache::instance().setCustomNameCheckCallback(LLAvatarNameCache::custom_name_check_callback_t()); // <FS:Ansariel> Contact sets
LL_INFOS() << "Saving Name Cache" << LL_ENDL;
saveNameCache();
LL_INFOS() << "Saving Name Cache : COMPLETED" << LL_ENDL;
// Save experience cache if appropriate
if (LLExperienceCache::instanceExists())
{
LL_INFOS() << "Saving Experience Cache" << LL_ENDL;
LLExperienceCache::instance().cleanup();
LL_INFOS() << "Saving Experience Cache : COMPLETED" << LL_ENDL;
}
}
void LLAppViewer::disconnectViewer()
{
if (gDisconnected)
{
return;
}
gDisconnected = TRUE;// <FS:Beq> [FIRE-32453] [BUG-232971] disconnect sooner to force the cache write.
//
// Cleanup after quitting.
//
@ -6435,32 +6402,30 @@ void LLAppViewer::disconnectViewer()
{
LLSelectMgr::getInstance()->deselectAll();
}
// <FS:Beq> [FIRE-32453] [BUG-232971] Persist before disconnect
// Moved to separate function
// // save inventory if appropriate
// if (gInventory.isInventoryUsable()
// && gAgent.getID().notNull()) // Shouldn't be null at this stage
// {
// gInventory.cache(gInventory.getRootFolderID(), gAgent.getID());
// if (gInventory.getLibraryRootFolderID().notNull()
// && gInventory.getLibraryOwnerID().notNull())
// {
// gInventory.cache(
// gInventory.getLibraryRootFolderID(),
// gInventory.getLibraryOwnerID());
// }
// }
// LLAvatarNameCache::instance().setCustomNameCheckCallback(LLAvatarNameCache::custom_name_check_callback_t()); // <FS:Ansariel> Contact sets
// saveNameCache();
// if (LLExperienceCache::instanceExists())
// {
// // TODO: LLExperienceCache::cleanup() logic should be moved to
// // cleanupSingleton().
// LLExperienceCache::instance().cleanup();
// }
// save inventory if appropriate
if (gInventory.isInventoryUsable()
&& gAgent.getID().notNull()) // Shouldn't be null at this stage
{
gInventory.cache(gInventory.getRootFolderID(), gAgent.getID());
if (gInventory.getLibraryRootFolderID().notNull()
&& gInventory.getLibraryOwnerID().notNull())
{
gInventory.cache(
gInventory.getLibraryRootFolderID(),
gInventory.getLibraryOwnerID());
}
}
LLAvatarNameCache::instance().setCustomNameCheckCallback(LLAvatarNameCache::custom_name_check_callback_t()); // <FS:Ansariel> Contact sets
saveNameCache();
if (LLExperienceCache::instanceExists())
{
// TODO: LLExperienceCache::cleanup() logic should be moved to
// cleanupSingleton().
LLExperienceCache::instance().cleanup();
}
// </FS:Beq>
// close inventory interface, close all windows
LLSidepanelInventory::cleanup();
@ -6490,7 +6455,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.

View File

@ -287,7 +287,6 @@ private:
void idleNetwork();
void sendLogoutRequest();
void persistCachesAndSettings();
void disconnectViewer();
// *FIX: the app viewer class should be some sort of singleton, no?