Skip to content

Commit

Permalink
Fix for inklecate instances hogging CPU when they aren’t shut down pr…
Browse files Browse the repository at this point in the history
…operly.
  • Loading branch information
joethephish committed Feb 13, 2018
1 parent a10ce59 commit 32fa48a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions inklecate/CommandLinePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ public void Begin()
Console.Write("?> ");
string userInput = Console.ReadLine ();

// If we have null user input, it means that we're
// "at the end of the stream", or in other words, the input
// stream has closed, so there's nothing more we can do.
// We return immediately, since otherwise we get into a busy
// loop waiting for user input.
if (userInput == null) {
Console.WriteLine ("<User input stream closed.>");
return;
}

var inputParser = new InkParser (userInput);
var input = inputParser.CommandLineUserInput();

Expand Down

0 comments on commit 32fa48a

Please sign in to comment.