Closed phet-steele closed 7 years ago
I suspect that in ShoppingNode, visibleObserver
has been queued to be called before dispose
is called. And then when visibleObserver
is called, it attempts to perform operations on self
post-disposal. So the assertion in Node getParent
(line 777) fails:
776 getParent: function() {
777 assert && assert( this._parents.length <= 1, 'Cannot call getParent on a node with multiple parents' );
778 return this._parents.length ? this._parents[ 0 ] : null;
779 },
@jonathanolson Can you confirm that _parents
is scuttled when Node is disposed?
Btw... I have been unable to reproduce this with ?ea&screens=1&fuzzMouse
. And I'm unclear on why it would only happen infrequently.
Is this issue related to https://github.com/phetsims/scenery/issues/647 (SimpleDragHandler disposal)?
Hmmm... could be.
Can you confirm that _parents is scuttled when Node is disposed?
That's correct (checks for things like removeChild( disposedNode )
).
Is this issue related to phetsims/scenery#647 (SimpleDragHandler disposal)?
I don't see an immediate connection. This assertion failure is stemming from a step() instead of a pointer event.
Fixed in the above commit, using the same approach as in https://github.com/phetsims/graphing-lines/issues/83 (testing this.disposed
). Tested using ?ea&fuzzMouse
.
Since this is the second sim where I've had to do this, I'm a bit concerned that there is a general pattern to this problem. I will create a separate issue to discuss.
@phet-steele please verify.
@phet-steele is still seeing this after pulling, took ~1 hour to hit in fuzz test.
https://github.com/phetsims/scenery/issues/649 is going to make this workaround unnecessary, so let's hold off on this until that's done.
@phet-steele This has been fixed in phetsims/scenery#649, and the workaround in unit-rates has been reverted. Please pull scenery and unit-rates to verify.
Fuzzed master for an hour and saw no errors, closing.