mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
[294351] Fix leaking service tracker
This commit is contained in:
parent
ff4609c895
commit
7e5c056111
1 changed files with 131 additions and 127 deletions
|
@ -33,7 +33,7 @@ import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.debug.core.model.IDebugModelProvider;
|
import org.eclipse.debug.core.model.IDebugModelProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation of AbstractDebugTextHover using DSF services
|
* An implementation of AbstractDebugTextHover using DSF services.
|
||||||
*
|
*
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
|
@ -112,15 +112,19 @@ abstract public class AbstractDsfDebugTextHover extends AbstractDebugTextHover {
|
||||||
IFrameDMContext frame = getFrame();
|
IFrameDMContext frame = getFrame();
|
||||||
String sessionId = frame.getSessionId();
|
String sessionId = frame.getSessionId();
|
||||||
DsfServicesTracker dsfServicesTracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), sessionId);
|
DsfServicesTracker dsfServicesTracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), sessionId);
|
||||||
GetExpressionValueQuery query = new GetExpressionValueQuery(frame, expression, dsfServicesTracker);
|
try {
|
||||||
DsfSession session = DsfSession.getSession(sessionId);
|
GetExpressionValueQuery query = new GetExpressionValueQuery(frame, expression, dsfServicesTracker);
|
||||||
session.getExecutor().execute(query);
|
DsfSession session = DsfSession.getSession(sessionId);
|
||||||
try {
|
session.getExecutor().execute(query);
|
||||||
FormattedValueDMData data = query.get();
|
try {
|
||||||
if (data != null)
|
FormattedValueDMData data = query.get();
|
||||||
return data.getFormattedValue();
|
if (data != null)
|
||||||
} catch (Exception e) {
|
return data.getFormattedValue();
|
||||||
}
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
dsfServicesTracker.dispose();
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue