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.
This commit is contained in:
Tim Edwards 2018-04-19 16:14:17 -04:00
parent 5da432b821
commit 4fd3089cfc
1 changed files with 8 additions and 0 deletions

View File

@ -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;