diff options
author | Dmitry Oleshko <doleshko@productengine.com> | 2009-11-24 17:38:15 +0200 |
---|---|---|
committer | Dmitry Oleshko <doleshko@productengine.com> | 2009-11-24 17:38:15 +0200 |
commit | 614865edae734d8f8c4ad6b22eee928ec0f08d61 (patch) | |
tree | e4f63e5660a75206c5f47d497478ad96b683f12e | |
parent | ac52668b069deb61751c509794722a9fc1a7e86f (diff) |
fixed major bug (EXT-2748) Crash on exit from viewer without log in
When a focused control is being destroyed, focus gets passed to the login panel, that leads to crash if the panel has been destroyed already.
Made the focus manager reset keyboard focus in this case.
Found unreachable code in llstartup.cpp!
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llpanellogin.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 78f3469f0e..ec0f8e303c 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -391,6 +391,10 @@ LLPanelLogin::~LLPanelLogin() //// We know we're done with the image, so be rid of it. //gTextureList.deleteImage( mLogoImage ); + + // Controls having keyboard focus by default + // must reset it on destroy. (EXT-2748) + gFocusMgr.setDefaultKeyboardFocus(NULL); } // virtual @@ -682,8 +686,6 @@ void LLPanelLogin::closePanel() if (sInstance) { gViewerWindow->getRootView()->removeChild( LLPanelLogin::sInstance ); - - gFocusMgr.setDefaultKeyboardFocus(NULL); delete sInstance; sInstance = NULL; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d36ff1605e..736be67710 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2153,7 +2153,7 @@ void login_callback(S32 option, void *userdata) LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); return; } - else if (QUIT_OPTION == option) + else if (QUIT_OPTION == option) // *TODO: THIS CODE SEEMS TO BE UNREACHABLE!!!!! login_callback is never called with option equal to QUIT_OPTION { // Make sure we don't save the password if the user is trying to clear it. std::string first, last, password; |