diff options
author | Julian Honnen | 2020-10-20 15:22:13 +0000 |
---|---|---|
committer | Julian Honnen | 2020-10-22 06:06:04 +0000 |
commit | 5b5b4b786f679ba15f8bffbbde3fb6dea1e01bfc (patch) | |
tree | a825c5160b34bbc833365768f3178e8e05e9ba88 /org.eclipse.debug.core | |
parent | 49a5770c15f2cef2d0f10cfc9359312e9f38186b (diff) | |
download | eclipse.platform.debug-5b5b4b786f679ba15f8bffbbde3fb6dea1e01bfc.tar.gz eclipse.platform.debug-5b5b4b786f679ba15f8bffbbde3fb6dea1e01bfc.tar.xz eclipse.platform.debug-5b5b4b786f679ba15f8bffbbde3fb6dea1e01bfc.zip |
Bug 568042 - provide ILogicalStructureTypeDelegate3#releaseValue APIY20201025-1200Y20201024-1200Y20201023-1200I20201026-0840I20201026-0650I20201025-1800I20201025-0040I20201024-1800I20201023-1800I20201023-0250
Provide an API to allow logical structure type delegates to garbage
collect their logical structures once they're no longer displayed.
Change-Id: I25e78c4d5fb84d54d6e47a6b0f12998b6b8b4f37
Signed-off-by: Julian Honnen <julian.honnen@vector.com>
Diffstat (limited to 'org.eclipse.debug.core')
2 files changed, 45 insertions, 1 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate3.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate3.java new file mode 100644 index 000000000..8ba0d52e6 --- /dev/null +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate3.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2020 Julian Honnen + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Julian Honnen <julian.honnen@vector.com> - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.core.model; + +/** + * Optional extension to <code>ILogicalStructureTypeDelegate</code> that allows + * a logical structure type delegate to garbage collect its logical structures + * once they're no longer displayed. + * + * @since 3.17 + * @see ILogicalStructureTypeDelegate + */ +public interface ILogicalStructureTypeDelegate3 { + + /** + * Called when the logical structure returned from + * {@link ILogicalStructureTypeDelegate#getLogicalStructure(IValue)} is no + * longer used and can be discarded. + * + * @param logicalStructure the logical structure value to discard + */ + void releaseValue(IValue logicalStructure); + +} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java index 7fc9d1739..074fc67d7 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java @@ -23,6 +23,7 @@ import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILogicalStructureType; import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate; import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate2; +import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate3; import org.eclipse.debug.core.model.IValue; /** @@ -30,7 +31,7 @@ import org.eclipse.debug.core.model.IValue; * * @see IConfigurationElementConstants */ -public class LogicalStructureType implements ILogicalStructureType { +public class LogicalStructureType implements ILogicalStructureType, ILogicalStructureTypeDelegate3 { private IConfigurationElement fConfigurationElement; private ILogicalStructureTypeDelegate fDelegate; @@ -108,6 +109,14 @@ public class LogicalStructureType implements ILogicalStructureType { return false; } + @Override + public void releaseValue(IValue logicalStructure) { + ILogicalStructureTypeDelegate delegate = getDelegate(); + if (delegate instanceof ILogicalStructureTypeDelegate3) { + ((ILogicalStructureTypeDelegate3) delegate).releaseValue(logicalStructure); + } + } + /** * Returns the <code>ILogicalStructuresTypeDelegate</code> delegate * @return the delegate |