From a5a3d5cf654ce07f28f05a966f5c6aaa1d2a4adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Thu, 28 Sep 2017 09:59:15 +0200 Subject: [PATCH] make sure inheritance hierarchies are consistently made temporary --- history.txt | 1 + objects.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/history.txt b/history.txt index 1eac4ab8..f809bec5 100755 --- a/history.txt +++ b/history.txt @@ -3669,6 +3669,7 @@ Fixes: * GUI: enable experimental setting for "ternary Boolean slots" * GUI, Blocks: experimental feature: Download script, thanks, Bernat! * Blocks: made "import script" undoable +* Objects: make sure inheritance hierarchies are consistently made temporary v4.1 Features: diff --git a/objects.js b/objects.js index 64f46ec4..fab049dc 100644 --- a/objects.js +++ b/objects.js @@ -83,7 +83,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize, TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph, AlignmentMorph*/ -modules.objects = '2017-September-25'; +modules.objects = '2017-September-28'; var SpriteMorph; var StageMorph; @@ -3412,6 +3412,10 @@ SpriteMorph.prototype.perpetuate = function () { var stage = this.parentThatIsA(StageMorph), ide = this.parentThatIsA(IDE_Morph); + // make sure my exemplar-chain is fully perpetuated + if (this.exemplar) { + this.exemplar.perpetuate(); + } if (!this.isTemporary || !stage || !ide) { return; } @@ -3446,9 +3450,14 @@ SpriteMorph.prototype.release = function () { if (this.isTemporary || !this.exemplar || !stage || !ide) { return; } + + // make sure all parts and instances are also released this.parts.forEach(function (part) { part.release(); }); + this.instances.forEach(function (inst) { + inst.release(); + }); this.isTemporary = true; this.name = ''; this.cloneOriginName = this.exemplar.name;