From 050b8ba205f4f59c9b2f471ae494141d9e9f06d6 Mon Sep 17 00:00:00 2001 From: skolb Date: Wed, 2 Dec 2009 16:55:45 -0800 Subject: DEV-42150 crash when using media on a HUD --- indra/newview/llviewerkeyboard.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerkeyboard.cpp') diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 8fd646ee93..623d128f87 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -538,8 +538,13 @@ void start_chat( EKeystate s ) void start_gesture( EKeystate s ) { + LLUICtrl* focus_ctrlp = NULL; + if(gFocusMgr.getKeyboardFocus()) + { + focus_ctrlp = dynamic_cast(gFocusMgr.getKeyboardFocus()); + } if (KEYSTATE_UP == s && - !(gFocusMgr.getKeyboardFocus() && dynamic_cast(gFocusMgr.getKeyboardFocus())->acceptsTextInput())) + !(gFocusMgr.getKeyboardFocus() && focus_ctrlp && focus_ctrlp->acceptsTextInput())) { if (LLNearbyChatBar::getInstance()->getCurrentChat().empty()) { -- cgit v1.2.3 From 4e0706f641cd99873def5a3e7b8e808bc219bfcc Mon Sep 17 00:00:00 2001 From: skolb Date: Wed, 2 Dec 2009 17:10:21 -0800 Subject: Cleaned up the conditional code a bit in llviewerkeyboard.cpp, start_gesture --- indra/newview/llviewerkeyboard.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerkeyboard.cpp') diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 623d128f87..f757155b94 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -538,13 +538,9 @@ void start_chat( EKeystate s ) void start_gesture( EKeystate s ) { - LLUICtrl* focus_ctrlp = NULL; - if(gFocusMgr.getKeyboardFocus()) - { - focus_ctrlp = dynamic_cast(gFocusMgr.getKeyboardFocus()); - } + LLUICtrl* focus_ctrlp = dynamic_cast(gFocusMgr.getKeyboardFocus()); if (KEYSTATE_UP == s && - !(gFocusMgr.getKeyboardFocus() && focus_ctrlp && focus_ctrlp->acceptsTextInput())) + ! (focus_ctrlp && focus_ctrlp->acceptsTextInput())) { if (LLNearbyChatBar::getInstance()->getCurrentChat().empty()) { -- cgit v1.2.3