IDEA-158216 - Docker: unable to reopen Inspect window

+ leak fixed - log manager should forget disposed logs
This commit is contained in:
Michael Golubev
2018-11-08 01:31:44 +01:00
parent 564857ba07
commit 34bdb37d8f
2 changed files with 13 additions and 0 deletions
@@ -32,6 +32,8 @@ public interface DeploymentLogManager {
@NotNull
LoggingHandler addAdditionalLog(@NotNull String presentableName);
void removeAdditionalLog(@NotNull String presentableName);
boolean isTtySupported();
TerminalHandler addTerminal(@NotNull String presentableName, InputStream terminalOutput, OutputStream terminalInput);
@@ -79,6 +79,17 @@ public class DeploymentLogManagerImpl implements DeploymentLogManager {
return handler;
}
@Override
public void removeAdditionalLog(@NotNull String presentableName) {
synchronized (myAdditionalLoggingHandlers) {
myAdditionalLoggingHandlers.stream()
.filter(next -> presentableName.equals(next.getPresentableName()))
.findAny()
.ifPresent(myAdditionalLoggingHandlers::remove);
}
myChangeListener.run();
}
@NotNull
public LoggingHandler findOrCreateAdditionalLog(@NotNull String presentableName) {
synchronized (myAdditionalLoggingHandlers) {