private <T> void disposeSwing(CompletableFuture<T> cf, Consumer<T> clearer) {

		if (cf == null) {
			// never loaded
			return;
		}

		if (!cf.isDone()) {
			cf.cancel(true);
			return;
		}

		if (cf.isCompletedExceptionally()) {
			return;
		}

		// clear the contents of the future, as it is acting like a cache
		T result = cf.getNow(null);
		if (result != null) {
			clearer.accept(result);
		}
	}
Signals to this path highlighter that it should stop all background jobs
Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/VisualGraphPathHighlighter.java