From 4fd3089cfce161de5356b6fe03ddbaa19069f371 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Thu, 19 Apr 2018 16:14:17 -0400 Subject: [PATCH] Corrected an error in which the selection definition may contain invalid pointers to a cell that was deleted while it was selected. Solution is to clear selections before deleting a cell. --- commands/CmdCD.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/commands/CmdCD.c b/commands/CmdCD.c index e4c03a85..0866cef5 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -741,11 +741,19 @@ CmdCellname(w, cmd) case IDX_DELETE: /* Unload the cell definition and free memory */ + /* Make sure selections are cleared or they may */ + /* contain references to the deleted cell def. */ if ((locargc == 4) && !strcmp(cmd->tx_argv[3 + ((dolist) ? 1 : 0)], "-noprompt")) + { + SelectClear(); DBCellDelete(cellname, TRUE); + } else if (locargc == 3) + { + SelectClear(); DBCellDelete(cellname, FALSE); + } else TxError("Delete cell command missing cellname\n"); break;