phetsims / scenery-phet

Reusable components based on Scenery that are specific to PhET simulations.
http://scenerystack.org/
MIT License
9 stars 6 forks source link

BackgroundNode memory leak #850

Closed pixelzoom closed 7 months ago

pixelzoom commented 7 months ago

Related to https://github.com/phetsims/graphing-lines/issues/153, uses of NumberPicker and subclass CoordinatePicker.

BackgroundNode needs to implement dispose to unlink this:

    node.boundsProperty.link( bounds => {
      if ( !bounds.isEmpty() ) {
        this.background.setRect( 0, 0, node.width + 2 * options.xMargin, node.height + 2 * options.yMargin );
        wrapperNode.center = this.background.center;
      }
    } );
pixelzoom commented 7 months ago

Cherry picked to graphing-lines and graphing-slope-intercept for https://github.com/phetsims/graphing-lines/issues/153.

Closing.