mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
fix: disposing of a workspace that has overwritten shadows (#6424)
* fix: disposing of a workspace that has overwritten shadows * fix: try slightly different placement to fix tests * fix: add disposing parameter to guaruntee consistent behavior * chore: wrap properties in a isDeadOrDying method * chore: make disposing private
This commit is contained in:
@@ -258,7 +258,8 @@ export abstract class Field implements IASTNodeLocationSvg,
|
||||
* @returns The renderer constant provider.
|
||||
*/
|
||||
getConstants(): ConstantProvider|null {
|
||||
if (!this.constants_ && this.sourceBlock_ && !this.sourceBlock_.disposed &&
|
||||
if (!this.constants_ && this.sourceBlock_ &&
|
||||
!this.sourceBlock_.isDeadOrDying() &&
|
||||
this.sourceBlock_.workspace.rendered) {
|
||||
this.constants_ = (this.sourceBlock_.workspace as WorkspaceSvg)
|
||||
.getRenderer()
|
||||
@@ -1050,7 +1051,7 @@ export abstract class Field implements IASTNodeLocationSvg,
|
||||
* @param e Mouse down event.
|
||||
*/
|
||||
protected onMouseDown_(e: Event) {
|
||||
if (!this.sourceBlock_ || this.sourceBlock_.disposed) {
|
||||
if (!this.sourceBlock_ || this.sourceBlock_.isDeadOrDying()) {
|
||||
return;
|
||||
}
|
||||
const gesture = (this.sourceBlock_.workspace as WorkspaceSvg).getGesture(e);
|
||||
|
||||
Reference in New Issue
Block a user