Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2015-02-05 05:28:25 +0000
committerSergey Prigogin2015-02-05 05:28:25 +0000
commit772ac2fa74a0a30cdd1c47c8b93a4503a52c8b72 (patch)
tree053a946750a99536d8755e7a9883c96a55bf114e
parent91981f94534e7fe0f28b1f43e3b171039194bd16 (diff)
downloadorg.eclipse.cdt-772ac2fa74a0a30cdd1c47c8b93a4503a52c8b72.tar.gz
org.eclipse.cdt-772ac2fa74a0a30cdd1c47c8b93a4503a52c8b72.tar.xz
org.eclipse.cdt-772ac2fa74a0a30cdd1c47c8b93a4503a52c8b72.zip
Bug 459186 - Index read locks are leaking
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SurroundWithTemplateMenuAction.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SurroundWithTemplateMenuAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SurroundWithTemplateMenuAction.java
index 770375a7477..6dc4c3683c3 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SurroundWithTemplateMenuAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/SurroundWithTemplateMenuAction.java
@@ -296,11 +296,15 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
TemplateCompletionProposalComputer templateComputer = new TemplateCompletionProposalComputer();
CContentAssistInvocationContext context = new CContentAssistInvocationContext( editor.getViewer(), textSelection.getOffset(), editor, true, false );
- List<ICompletionProposal> proposals= templateComputer.computeCompletionProposals(context, null);
- if (proposals == null || proposals.isEmpty())
- return null;
-
- return getActionsFromProposals(proposals, context.getInvocationOffset(), editor.getViewer());
+ try {
+ List<ICompletionProposal> proposals= templateComputer.computeCompletionProposals(context, null);
+ if (proposals == null || proposals.isEmpty())
+ return null;
+
+ return getActionsFromProposals(proposals, context.getInvocationOffset(), editor.getViewer());
+ } finally {
+ context.dispose();
+ }
}
private static ITextSelection getTextSelection(CEditor editor) {

Back to the top