Fix for "cannot access member `sessionUUID' of deleted QObject" error

This commit is contained in:
Thijs Wenker 2016-12-09 02:44:43 +01:00
parent 28e8bb69ec
commit 3ceac7d071

View file

@ -26,6 +26,7 @@ var POSSIBLE_AC_AVATARS = [
AvatarFinderBeacon = function(avatar) {
var visible = false;
var avatarSessionUUID = avatar.sessionUUID;
this.overlay = Overlays.addOverlay('line3d', {
color: BEAM_COLOR,
dashed: false,
@ -35,7 +36,7 @@ AvatarFinderBeacon = function(avatar) {
visible: visible,
drawInFront: SHOW_THROUGH_WALLS,
ignoreRayIntersection: true,
parentID: avatar.sessionUUID,
parentID: avatarSessionUUID,
parentJointIndex: -2
});
this.cleanup = function() {
@ -45,7 +46,7 @@ AvatarFinderBeacon = function(avatar) {
return (Vec3.distance(MyAvatar.position, avatar.position) >= MIN_DISPLAY_DISTANCE);
};
this.update = function() {
avatar = AvatarList.getAvatar(avatar.sessionUUID);
avatar = AvatarList.getAvatar(avatarSessionUUID);
Overlays.editOverlay(this.overlay, {
visible: this.shouldShow()
});