Get rid of unnecessary nulls in block dragger, insertion marker manager, and gesture dispose functions.

This commit is contained in:
Rachel Fenichel
2019-10-03 17:58:29 -07:00
parent e4cc2217e6
commit 45d66a1264
3 changed files with 0 additions and 22 deletions

View File

@@ -100,14 +100,10 @@ Blockly.BlockDragger = function(block, workspace) {
* @package
*/
Blockly.BlockDragger.prototype.dispose = function() {
this.draggingBlock_ = null;
this.workspace_ = null;
this.startWorkspace_ = null;
this.dragIconData_.length = 0;
if (this.draggedConnectionManager_) {
this.draggedConnectionManager_.dispose();
this.draggedConnectionManager_ = null;
}
};

View File

@@ -250,24 +250,14 @@ Blockly.Gesture.prototype.dispose = function() {
Blockly.unbindEvent_(this.onUpWrapper_);
}
this.startField_ = null;
this.startBlock_ = null;
this.targetBlock_ = null;
this.startWorkspace_ = null;
this.flyout_ = null;
if (this.blockDragger_) {
this.blockDragger_.dispose();
this.blockDragger_ = null;
}
if (this.workspaceDragger_) {
this.workspaceDragger_.dispose();
this.workspaceDragger_ = null;
}
if (this.bubbleDragger_) {
this.bubbleDragger_.dispose();
this.bubbleDragger_ = null;
}
};

View File

@@ -146,27 +146,19 @@ Blockly.InsertionMarkerManager = function(block) {
* @package
*/
Blockly.InsertionMarkerManager.prototype.dispose = function() {
this.topBlock_ = null;
this.workspace_ = null;
this.availableConnections_.length = 0;
this.closestConnection_ = null;
this.localConnection_ = null;
Blockly.Events.disable();
try {
if (this.firstMarker_) {
this.firstMarker_.dispose();
this.firstMarker_ = null;
}
if (this.lastMarker_) {
this.lastMarker_.dispose();
this.lastMarker_ = null;
}
} finally {
Blockly.Events.enable();
}
this.highlightedBlock_ = null;
};
/**