Context shutdown fixes

This commit is contained in:
crschnick 2024-09-23 13:57:41 +00:00
parent eec1b807b2
commit 3fe38a4261
4 changed files with 7 additions and 3 deletions

View file

@ -167,6 +167,9 @@ public class StoreCreationComp extends DialogComp {
v -> true,
(newE, context, validated) -> {
ThreadHelper.runAsync(() -> {
if (context != null) {
context.close();
}
if (!DataStorage.get().getStoreEntries().contains(e)) {
DataStorage.get().addStoreEntryIfNotPresent(newE);
} else {
@ -196,7 +199,7 @@ public class StoreCreationComp extends DialogComp {
(e, context, validated) -> {
try {
DataStorage.get().addStoreEntryIfNotPresent(e);
if (validated
if (context != null && validated
&& e.getProvider().shouldShowScan()
&& AppPrefs.get()
.openConnectionSearchWindowOnConnectionCreation()

View file

@ -34,6 +34,8 @@ public interface ProcessControl extends AutoCloseable {
@Override
void close() throws Exception;
void shutdown() throws Exception;
void kill();
ProcessControl start() throws Exception;

View file

@ -17,7 +17,7 @@ public class ShellValidationContext implements ValidationContext<ShellControl> {
@Override
public void close() {
try {
shellControl.close();
shellControl.shutdown();
} catch (Exception ignored) {
}
}

View file

@ -167,7 +167,6 @@ init=Init
shell=Shell
hub=Hub
#context: Computer script
#force
script=script