Skip to content

Commit

Permalink
Time out on window initialization after 30 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Nov 9, 2023
1 parent c802eb3 commit f5b2449
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,12 @@ private void handleLastGLFWError(BiConsumer<Integer, String> handler) {
public long setupMinecraftWindow(final IntSupplier width, final IntSupplier height, final Supplier<String> title, final LongSupplier monitorSupplier) {
// wait for the window to actually be initialized
try {
this.initializationFuture.get();
this.initializationFuture.get(30, TimeUnit.SECONDS);
} catch(InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
} catch(TimeoutException e) {
Thread.dumpStack();
crashElegantly("We seem to be having trouble initializing the window, waited for 30 seconds");
}
// we have to spin wait for the window ticker
ImmediateWindowHandler.updateProgress("Initializing Game Graphics");
Expand Down

0 comments on commit f5b2449

Please sign in to comment.