public synchronized void dispose() {

		clearTasks();
		List<DomainObject> list = new ArrayList<>(queuedCommandsMap.keySet());
		for (DomainObject obj : list) {
			clearQueuedCommands(obj);
		}
		queuedCommandsMap = new HashMap<>();

		toolTaskMonitor.dispose();
		if (modalTaskDialog != null) {
			modalTaskDialog.dispose();
		}

		tool = null;
	}
Clear list of tasks and queue of scheduled commands.
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/mgr/ToolTaskManager.java