mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +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() {
|
AvatarActionHold::~AvatarActionHold() {
|
||||||
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
// Sometimes actions are destroyed after the AvatarManager is destroyed by the Application.
|
||||||
if (myAvatar) {
|
auto avatarManager = DependencyManager::get<AvatarManager>();
|
||||||
myAvatar->removeHoldAction(this);
|
if (avatarManager) {
|
||||||
|
auto myAvatar = avatarManager->getMyAvatar();
|
||||||
|
if (myAvatar) {
|
||||||
|
myAvatar->removeHoldAction(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WANT_DEBUG
|
#if WANT_DEBUG
|
||||||
|
|
Loading…
Reference in a new issue