diff options
author | Richard Linden <none@none> | 2010-10-13 11:57:38 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2010-10-13 11:57:38 -0700 |
commit | 0732b48be9c6378c31515ed92d29101e3743c8c9 (patch) | |
tree | ae24d2f52e6829eaaab50ce73213cf6b310bd772 /indra/newview/llappviewer.cpp | |
parent | 867570132f3ff2dc102561e0d0950b0134dd3e53 (diff) |
improved fastquit logic which should reliably disconnect viewer from sim
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 91fae709df..a245639fac 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1284,6 +1284,21 @@ bool LLAppViewer::mainLoop() return true; } +void LLAppViewer::flushVFSIO() +{ + while (1) + { + S32 pending = LLVFSThread::updateClass(0); + pending += LLLFSThread::updateClass(0); + if (!pending) + { + break; + } + llinfos << "Waiting for pending IO to finish: " << pending << llendflush; + ms_sleep(100); + } +} + bool LLAppViewer::cleanup() { // workaround for DEV-35406 crash on shutdown @@ -1419,17 +1434,7 @@ bool LLAppViewer::cleanup() llinfos << "Cache files removed" << llendflush; // Wait for any pending VFS IO - while (1) - { - S32 pending = LLVFSThread::updateClass(0); - pending += LLLFSThread::updateClass(0); - if (!pending) - { - break; - } - llinfos << "Waiting for pending IO to finish: " << pending << llendflush; - ms_sleep(100); - } + flushVFSIO(); llinfos << "Shutting down Views" << llendflush; // Destroy the UI @@ -2879,13 +2884,20 @@ void LLAppViewer::forceQuit() LLApp::setQuitting(); } -void LLAppViewer::fastQuit() +void LLAppViewer::fastQuit(S32 error_code) { - if (LLStartUp::getStartupState() >= STATE_STARTED) - { - sendLogoutRequest(); - } - _exit(isError()); + // finish pending transfers + flushVFSIO(); + // let sim know we're logging out + sendLogoutRequest(); + // flush network buffers by shutting down messaging system + end_messaging_system(); + // figure out the error code + S32 final_error_code = error_code ? error_code : (S32)isError(); + // this isn't a crash + removeMarkerFile(); + // get outta here + _exit(final_error_code); } void LLAppViewer::requestQuit() @@ -2973,14 +2985,6 @@ void LLAppViewer::earlyExitNoNotify() finish_early_exit( LLSD(), LLSD() ); } -void LLAppViewer::forceExit(S32 arg) -{ - removeMarkerFile(); - - // *FIX:Mani - This kind of exit hardly seems appropriate. - exit(arg); -} - void LLAppViewer::abortQuit() { llinfos << "abortQuit()" << llendl; |