mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
Merge pull request #8796 from hyperlogic/bug-fix/avatar-hold-action-crash-on-exit
Prevent crash on exit.
This commit is contained in:
commit
635e3d1ea1
1 changed files with 7 additions and 3 deletions
|
@ -37,9 +37,13 @@ AvatarActionHold::AvatarActionHold(const QUuid& id, EntityItemPointer ownerEntit
|
|||
}
|
||||
|
||||
AvatarActionHold::~AvatarActionHold() {
|
||||
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||
if (myAvatar) {
|
||||
myAvatar->removeHoldAction(this);
|
||||
// Sometimes actions are destroyed after the AvatarManager is destroyed by the Application.
|
||||
auto avatarManager = DependencyManager::get<AvatarManager>();
|
||||
if (avatarManager) {
|
||||
auto myAvatar = avatarManager->getMyAvatar();
|
||||
if (myAvatar) {
|
||||
myAvatar->removeHoldAction(this);
|
||||
}
|
||||
}
|
||||
|
||||
#if WANT_DEBUG
|
||||
|
|
Loading…
Reference in a new issue