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:
parent
91981f9453
commit
772ac2fa74
1 changed files with 9 additions and 5 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue