SL-19891 Make sure focusable elements clear focus on destruction

master
Andrey Kleshchev 2023-07-18 01:56:42 +03:00
parent 37f41392cd
commit bc3f2d53d1
7 changed files with 25 additions and 7 deletions

View File

@ -497,13 +497,20 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
// request asset
mAssetStatus = ASSET_FETCHED;
LL_DEBUGS("Animation") << "Requesting data fetch for: " << mID << LL_ENDL;
character_id = new LLUUID(mCharacter->getID());
gAssetStorage->getAssetData(mID,
LLAssetType::AT_ANIMATION,
onLoadComplete,
(void *)character_id,
FALSE);
if (mID.notNull())
{
LL_DEBUGS("Animation") << "Requesting data fetch for: " << mID << LL_ENDL;
character_id = new LLUUID(mCharacter->getID());
gAssetStorage->getAssetData(mID,
LLAssetType::AT_ANIMATION,
onLoadComplete,
(void*)character_id,
FALSE);
}
else
{
LL_INFOS("Animation") << "Attempted to fetch animation " << mName << " with null id for character " << mCharacter->getID() << LL_ENDL;
}
return STATUS_HOLD;
case ASSET_FETCHED:

View File

@ -68,6 +68,7 @@ LLDragHandle::LLDragHandle(const LLDragHandle::Params& p)
LLDragHandle::~LLDragHandle()
{
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
removeChild(mTitleBox);
delete mTitleBox;
}

View File

@ -177,6 +177,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
LLFolderViewItem::~LLFolderViewItem()
{
mViewModelItem = NULL;
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}
BOOL LLFolderViewItem::postBuild()

View File

@ -89,6 +89,8 @@ LLLayoutPanel::~LLLayoutPanel()
// probably not necessary, but...
delete mResizeBar;
mResizeBar = NULL;
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}
F32 LLLayoutPanel::getAutoResizeFactor() const

View File

@ -70,6 +70,11 @@ LLResizeHandle::LLResizeHandle(const LLResizeHandle::Params& p)
}
}
LLResizeHandle::~LLResizeHandle()
{
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}
BOOL LLResizeHandle::handleMouseDown(S32 x, S32 y, MASK mask)
{

View File

@ -45,6 +45,7 @@ public:
Params();
};
~LLResizeHandle();
protected:
LLResizeHandle(const LLResizeHandle::Params&);
friend class LLUICtrlFactory;

View File

@ -63,6 +63,7 @@ LLViewerMediaFocus::~LLViewerMediaFocus()
{
// The destructor for LLSingletons happens at atexit() time, which is too late to do much.
// Clean up in cleanupClass() instead.
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}
void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal)