diff --git a/src/main/java/com/googlecode/lanterna/gui2/AbstractTextGUIThread.java b/src/main/java/com/googlecode/lanterna/gui2/AbstractTextGUIThread.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/googlecode/lanterna/gui2/AbstractTextGUIThread.java
+++ b/src/main/java/com/googlecode/lanterna/gui2/AbstractTextGUIThread.java
@@ -74,8 +74,12 @@ public abstract class AbstractTextGUIThread implements TextGUIThread {
             invokeLater(new Runnable() {
                 @Override
                 public void run() {
-                    runnable.run();
-                    countDownLatch.countDown();
+                    try {
+                        runnable.run();
+                    }
+                    finally {
+                        countDownLatch.countDown();
+                    }
                 }
             });
             countDownLatch.await();
Protect from exceptions causing the latch to remain locked forever