cleanup errors

This commit is contained in:
James B. Pollack 2016-02-22 10:25:56 -08:00
parent 214723f1bf
commit f0d8ffce65
3 changed files with 9 additions and 10 deletions

View file

@ -44,12 +44,6 @@
this.getTotalWait = function() { this.getTotalWait = function() {
return (Math.random() * 5000) * 2; return (Math.random() * 5000) * 2;
// var avatars = AvatarList.getAvatarIdentifiers();
// var avatarCount = avatars.length;
// var random = Math.random() * 5000;
// var totalWait = random * (avatarCount * 2);
// print('cellscience color avatarcount, totalwait: ', avatarCount, totalWait)
// return totalWait
} }
@ -86,7 +80,9 @@
this.unload = function() { this.unload = function() {
baton.release(function() {}); if (baton) {
baton.release(function() {});
}
Script.clearInterval(currentInterval); Script.clearInterval(currentInterval);
} }

View file

@ -40,7 +40,7 @@
this.minAngularVelocity = 0.01; this.minAngularVelocity = 0.01;
this.maxAngularVelocity = 0.03; this.maxAngularVelocity = 0.03;
baton = virtualBaton({ baton = virtualBaton({
batonName: 'io.highfidelity.vesicles:' + entityId, // One winner for each entity batonName: 'io.highfidelity.vesicles:' + entityID, // One winner for each entity
}); });
stopUpdateAndReclaim(); stopUpdateAndReclaim();
currentInterval = Script.setInterval(self.move, self.getTotalWait()) currentInterval = Script.setInterval(self.move, self.getTotalWait())
@ -127,7 +127,10 @@
if (this.initTimeout !== null) { if (this.initTimeout !== null) {
Script.clearTimeout(this.initTimeout); Script.clearTimeout(this.initTimeout);
} }
baton.release(function() {}); if (baton) {
baton.release(function() {});
}
Script.clearInterval(currentInterval); Script.clearInterval(currentInterval);
} }

View file

@ -5,7 +5,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
var version = 1049; var version = 1051;
var cellLayout; var cellLayout;
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/"; var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";