From cd6713f611710d8ab72f75f6013b81c4d814f9e6 Mon Sep 17 00:00:00 2001 From: Arturo Fonseca <49870466+arturo32@users.noreply.github.com> Date: Mon, 2 Dec 2024 00:04:11 -0300 Subject: [PATCH] fix: pointer arrows from heap to heap --- memoryCell.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/memoryCell.js b/memoryCell.js index eab7429..aa718bc 100644 --- a/memoryCell.js +++ b/memoryCell.js @@ -29,6 +29,13 @@ export default { this.createPointerArrow(); } }, + unmounted() { + if(this.variable[1][2][0] === '*' || this.variable[1][2] === 'pointer') { + if(globalArrows.has(this.address + this.content)) { + globalArrows.get(this.address + this.content).remove(); + } + } + }, methods: { createPointerArrow() { if(this.content !== '?') { @@ -44,7 +51,7 @@ export default { { path: 'fluid', startSocket: 'right', - endSocket: isPointedCellHeap? 'left' : 'right', + endSocket: isPointedCellHeap? (this.isInHeap? 'right' : 'left') : 'right', startSocketGravity: isPointedCellHeap? [15, 0] : [15, 0], endSocketGravity: isPointedCellHeap? [-20, 0] : [20, 0], endPlug: 'arrow3',