public void doDeleteVariable(VariableSymbolDB symbol) {
		manager.lock.acquire();
		try {
			startUpdate();
			if (!checkIsValid()) {
				return;
			}

			if (isBadVariable(symbol)) {
				// don't do anything here with bad variable symbol
				return;
			}

			loadVariables();
			VariableDB var = symbolMap.remove(symbol);

			if (var != null) {
				if (var instanceof Parameter) {
					if (removeVariable(params, var)) {
						updateParametersAndReturn();
					}
				}
				else {
					removeVariable(locals, var);
				}
			}

			manager.functionChanged(this, (var instanceof Parameter) ? PARAMETERS_CHANGED : null);
			frame.setInvalid();
		}
		finally {
			endUpdate();
			manager.lock.release();
		}
	}
Callback to remove variable just prior to removal
of the underlying symbol.
@param symbol variable symbol which is about to be deleted.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionDB.java