@Override
	public void dispose() {
		for (String treeName : providerMap.keySet()) {
			TreeViewProvider provider = providerMap.get(treeName);
			deregisterService(ViewProviderService.class, provider);
			provider.dispose();
		}

		goToService = null;
		viewManagerService = null;
		if (currentProgram != null) {
			currentProgram.removeListener(programListener);
		}

		if (programListener != null) {
			programListener.dispose();
		}

		componentProvider.dispose();
		super.dispose();
	}
Tells a plugin that it is no longer needed. The plugin should remove
itself from anything that it is registered to and release any resources.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreePlugin.java