diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java index 8dacb070466..1cfd84a8586 100644 --- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java +++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java @@ -739,7 +739,11 @@ public void start(BundleContext context) throws Exception { @Override public IWorkspace addingService(ServiceReference reference) { - IWorkspace workspace = super.addingService(reference); + IWorkspace workspace = context.getService(reference); + if (workspace == null) { + logMessage("Could not add save participant as IWorkspace service is unavailable", null); //$NON-NLS-1$ + return null; + } try { workspace.addSaveParticipant(getUniqueIdentifier(), new ISaveParticipant() { @Override @@ -764,6 +768,8 @@ public void doneSaving(ISaveContext saveContext) { }); } catch (CoreException e) { log(e.getStatus()); + context.ungetService(reference); + return null; } return workspace; } @@ -771,7 +777,7 @@ public void doneSaving(ISaveContext saveContext) { @Override public void removedService(ServiceReference reference, IWorkspace service) { service.removeSaveParticipant(getUniqueIdentifier()); - super.removedService(reference, service); + context.ungetService(reference); } };