From 8921fa96a9b714fbd80ba238a4bd5100342892e2 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Fri, 2 Aug 2019 09:37:02 -0700 Subject: [PATCH] Removed redundant connection disposal code from block. --- core/block.js | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/core/block.js b/core/block.js index 44bef90e3..6eb1f3628 100644 --- a/core/block.js +++ b/core/block.js @@ -316,12 +316,8 @@ Blockly.Block.prototype.dispose = function(healStack) { this.inputList.length = 0; // Dispose of any remaining connections (next/previous/output). var connections = this.getConnections_(true); - for (var i = 0; i < connections.length; i++) { - var connection = connections[i]; - if (connection.isConnected()) { - connection.disconnect(); - } - connections[i].dispose(); + for (var i = 0, connection; connection = connections[i]; i++) { + connection.dispose(); } } finally { Blockly.Events.enable(); @@ -1759,17 +1755,6 @@ Blockly.Block.prototype.moveNumberedInputBefore = function( Blockly.Block.prototype.removeInput = function(name, opt_quiet) { for (var i = 0, input; input = this.inputList[i]; i++) { if (input.name == name) { - if (input.connection && input.connection.isConnected()) { - input.connection.setShadowDom(null); - var block = input.connection.targetBlock(); - if (block.isShadow()) { - // Destroy any attached shadow block. - block.dispose(); - } else { - // Disconnect any attached normal block. - block.unplug(); - } - } input.dispose(); this.inputList.splice(i, 1); return;