Skip to content
Browse files

Merge branch '2.2.x'

  • Loading branch information...
2 parents 6d8593b + 3204c72 commit 943013384423b6044cd5a04717ad2e95aa5a25df @jeffbrown jeffbrown committed Nov 15, 2012
Showing with 11 additions and 3 deletions.
  1. +11 −3 scripts/Console.groovy
View
14 scripts/Console.groovy
@@ -22,6 +22,7 @@
* @since 0.4
*/
+import java.awt.Window
import java.awt.event.FocusEvent
import java.awt.event.FocusListener
@@ -43,9 +44,16 @@ target(console:"The console implementation target") {
console.run()
def watcher = new GrailsProjectWatcher(projectCompiler, pluginManager)
watcher.start()
- // keep the console running
- while (!InteractiveMode.isActive()) {
- sleep(Integer.MAX_VALUE)
+
+ while (console.frame.visible) {
+ sleep 500
+ }
+
+ // Keep the console running until all windows are closed unless the
+ // interactive console is in use. The interactive console keeps the
+ // VM alive so we don't need to keep this thread running.
+ while (!InteractiveMode.isActive() && Window.windows.any { it.visible }) {
+ sleep 3000
}
} catch (Exception e) {
event("StatusFinal", ["Error starting console: ${e.message}"])

0 comments on commit 9430133

Please sign in to comment.
Something went wrong with that request. Please try again.