private void removeRefs(AddressIterator iter, Set<SourceType> sourceTypesToClear)
			throws CancelledException {

		ReferenceManager referenceManager = program.getReferenceManager();
		while (iter.hasNext()) {

			monitor.checkCancelled();

			Address addr = iter.next();
			Reference[] refs = referenceManager.getReferencesFrom(addr);
			for (Reference ref : refs) {
				if (monitor.isCancelled()) {
					break;
				}
				SourceType source = ref.getSource();
				if (sourceTypesToClear.contains(source)) {
					referenceManager.delete(ref);
				}
			}
			monitor.incrementProgress(1);
		}
	}
Clears over the given range, <b>clearing only code</b>.  To clear other items,
use {@link #ClearCmd(AddressSetView,ClearOptions)}.

@param view the addresses over which to clear
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearCmd.java