diff --git a/src/main/java/org/myrobotlab/service/ImageDisplay.java b/src/main/java/org/myrobotlab/service/ImageDisplay.java index 4be2abae11..c00d3bddb8 100644 --- a/src/main/java/org/myrobotlab/service/ImageDisplay.java +++ b/src/main/java/org/myrobotlab/service/ImageDisplay.java @@ -113,6 +113,7 @@ public String close(String name) { display.frame.dispose(); display.frame = null; } + display.name = name; // displays.remove(src); return name; } @@ -157,7 +158,8 @@ public void display(String src, float opacity) { public String display(String name, String src) { Display display = getDisplay(name); display.src = src; - displayInternal(display.name); + display.name = name; + displayInternal(name); return name; } diff --git a/src/main/java/org/myrobotlab/service/Runtime.java b/src/main/java/org/myrobotlab/service/Runtime.java index 2ce5fd6828..ac4994c3ed 100644 --- a/src/main/java/org/myrobotlab/service/Runtime.java +++ b/src/main/java/org/myrobotlab/service/Runtime.java @@ -895,6 +895,7 @@ public static Runtime getInstance() { if (runtime == null) { c = ConfigUtils.loadRuntimeConfig(options); runtime = (Runtime) createService(RUNTIME_NAME, "Runtime", c.id); + runtime.platform = Platform.getLocalInstance(); runtime.startService(); // klunky Runtime.register(new Registration(runtime)); @@ -2845,13 +2846,8 @@ public Runtime(String n, String id) { setLocale(Locale.getDefault().getTag()); locales = Locale.getDefaults(); - - if (runtime.platform == null) { - runtime.platform = Platform.getLocalInstance(); - } - - // setting the id and the platform - platform = Platform.getLocalInstance(); + + Platform platform = Platform.getLocalInstance(); String libararyPath = System.getProperty("java.library.path"); String userDir = System.getProperty("user.dir");