List<String> getTooltipLines(int y, int x, Address minAddr, Address maxAddr) {
			List<String> lines = new ArrayList<>();
			for (MarkerSetImpl markers : IterableUtils.reversedIterable(markerSets)) {
				if (!markers.displayInMarkerBar()) {
					continue;
				}
				AddressSet set = markers.getAddressSet();
				AddressSet intersection = set.intersectRange(minAddr, maxAddr);
				for (Address a : intersection.getAddresses(true)) {
					lines.add(getMarkerToolTip(markers, a, x, y));
					if (markers instanceof AreaMarkerSet) {
						break; // no more tooltips from this area 
					}
					if (lines.size() >= MAX_TOOLTIP_LINES) {
						lines.add("...");
						return lines;
					}
				}
			}
			return lines;
		}
Use this close listener approach instead of plugin events, since we don't get a
ProgramClosedPluginEvent when a trace view is closed, but we can listen for its
domain object closing, which works for plain programs, too.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/marker/MarkerManager.java