mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 04:05:39 +00:00
Merge remote-tracking branch
'origin/GP-4962-dragonmacher-font-end-dispose-exception--SQUASHED' (Closes #6937)
This commit is contained in:
commit
a1c6452798
@ -44,6 +44,20 @@ public class DomainFolderChangesDisplayPlugin extends Plugin
|
||||
provider = new DomainFolderChangesDisplayComponentProvider(tool, getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serviceRemoved(Class<?> interfaceClass, Object service) {
|
||||
if (interfaceClass == FrontEndService.class) {
|
||||
((FrontEndService) service).removeProjectListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serviceAdded(Class<?> interfaceClass, Object service) {
|
||||
if (interfaceClass == FrontEndService.class) {
|
||||
((FrontEndService) service).addProjectListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
|
||||
@ -52,15 +66,19 @@ public class DomainFolderChangesDisplayPlugin extends Plugin
|
||||
projectOpened(activeProject);
|
||||
}
|
||||
|
||||
FrontEndService frontEnd = tool.getService(FrontEndService.class);
|
||||
frontEnd.addProjectListener(this);
|
||||
super.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispose() {
|
||||
|
||||
// Normal shutdown will have removed the FrontEndService at the point dispose() is called.
|
||||
// In this case, the listener is removed in a call to serviceRemoved(). If this plugin is
|
||||
// removed by the user, then dispose() is called and we need to remove the listener.
|
||||
FrontEndService frontEnd = tool.getService(FrontEndService.class);
|
||||
frontEnd.addProjectListener(this);
|
||||
if (frontEnd != null) {
|
||||
frontEnd.removeProjectListener(this);
|
||||
}
|
||||
|
||||
Project activeProject = tool.getProjectManager().getActiveProject();
|
||||
if (activeProject != null) {
|
||||
@ -89,14 +107,15 @@ public class DomainFolderChangesDisplayPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public void domainFolderRemoved(DomainFolder parent, String name) {
|
||||
provider.addText("domainFolderRemoved: parent=" + parent.getPathname() + ", name=" + name);
|
||||
public void domainFolderRemoved(DomainFolder parent, String folderName) {
|
||||
provider.addText(
|
||||
"domainFolderRemoved: parent=" + parent.getPathname() + ", name=" + folderName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void domainFileRemoved(DomainFolder parent, String name, String fileID) {
|
||||
provider.addText("domainFileRemoved: parent=" + parent.getPathname() + ", name=" + name +
|
||||
", fileID=" + fileID);
|
||||
public void domainFileRemoved(DomainFolder parent, String folderName, String fileID) {
|
||||
provider.addText("domainFileRemoved: parent=" + parent.getPathname() + ", name=" +
|
||||
folderName + ", fileID=" + fileID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -84,9 +84,8 @@ public class ServiceManager {
|
||||
}
|
||||
|
||||
private void notifyServiceAdded(Class<?> interfaceClass, Object service) {
|
||||
Iterator<?> it = serviceListeners.iterator();
|
||||
while (it.hasNext()) {
|
||||
((ServiceListener) it.next()).serviceAdded(interfaceClass, service);
|
||||
for (ServiceListener serviceListener : serviceListeners) {
|
||||
serviceListener.serviceAdded(interfaceClass, service);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user