protected void cleanup() {
		if (!disposed) {
			Throwable thr = null;
			try {
				disposed = true;
				dispose();
			}
			catch (Throwable t) {
				thr = t;
			}
			tool.removeServiceListener(this);
			unregisterServices();
			unregisterEvents();
			tool.removeAll(getName());
			tool = null;
			if (thr != null) {
				throw new RuntimeException(thr);
			}
		}
	}
Auto-registers any PluginEvents listed in the Plugin's description.
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/Plugin.java