1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +02:00

Bug 459186 - Index read locks are leaking

This commit is contained in:
Sergey Prigogin 2015-02-04 21:28:25 -08:00
parent 91981f9453
commit 772ac2fa74

View file

@ -296,11 +296,15 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
TemplateCompletionProposalComputer templateComputer = new TemplateCompletionProposalComputer(); TemplateCompletionProposalComputer templateComputer = new TemplateCompletionProposalComputer();
CContentAssistInvocationContext context = new CContentAssistInvocationContext( editor.getViewer(), textSelection.getOffset(), editor, true, false ); CContentAssistInvocationContext context = new CContentAssistInvocationContext( editor.getViewer(), textSelection.getOffset(), editor, true, false );
try {
List<ICompletionProposal> proposals= templateComputer.computeCompletionProposals(context, null); List<ICompletionProposal> proposals= templateComputer.computeCompletionProposals(context, null);
if (proposals == null || proposals.isEmpty()) if (proposals == null || proposals.isEmpty())
return null; return null;
return getActionsFromProposals(proposals, context.getInvocationOffset(), editor.getViewer()); return getActionsFromProposals(proposals, context.getInvocationOffset(), editor.getViewer());
} finally {
context.dispose();
}
} }
private static ITextSelection getTextSelection(CEditor editor) { private static ITextSelection getTextSelection(CEditor editor) {