diff --git a/sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java b/sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java index d00383389..72cd0d1bf 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java @@ -394,14 +394,14 @@ public class FakeApplication extends SimpleApplication { private ScheduledThreadPoolExecutor fakeAppThread = new ScheduledThreadPoolExecutor(1); public void cleanupFakeApp() { - if (rootNode == null) { - return; - } - clearNode(rootNode); + runQueuedFake(); appStateManager = new FakeAppStateManager(this); + if (rootNode != null) { + clearNode(rootNode); + } } - - public void startFakeApp(){ + + public void startFakeApp() { fakeAppThread = new ScheduledThreadPoolExecutor(1); } @@ -409,8 +409,8 @@ public class FakeApplication extends SimpleApplication { cleanupFakeApp(); fakeAppThread.shutdown(); } - - public void newAssetManager(AssetManager manager){ + + public void newAssetManager(AssetManager manager) { this.assetManager = manager; } diff --git a/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java b/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java index 8b406437e..8bd888b94 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java @@ -275,7 +275,7 @@ public class SceneApplication extends Application implements LookupProvider { fakeApp.stopFakeApp(); super.destroy(); } - + @Override public void update() { if (speed == 0) { @@ -324,8 +324,6 @@ public class SceneApplication extends Application implements LookupProvider { handleError(e.getMessage(), e); } } - - //TODO: Lookup for Application public Lookup createAdditionalLookup(Lookup baseContext) { @@ -477,7 +475,7 @@ public class SceneApplication extends Application implements LookupProvider { } private void checkSave(SceneRequest request) { - if ((request != null) + if ((request != null) && request.getDataObject() != null && request.getDataObject().isModified()) { final DataObject req = request.getDataObject(); Confirmation mesg = new NotifyDescriptor.Confirmation("Scene has not been saved,\ndo you want to save it?", @@ -658,5 +656,4 @@ public class SceneApplication extends Application implements LookupProvider { public boolean isAwt() { return java.awt.EventQueue.isDispatchThread(); } - }