Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added missing using() blocks around futures returned by BlockingQueue…

….Dequeue. Whoops. :(

Don't print nulls to stdout
  • Loading branch information...
commit 745dce06ceaf73d8428c0c5e4f6b8eb618bb48bd 1 parent 98173a1
K. Gadd authored
15 Common/Common.cs
View
@@ -152,7 +152,8 @@ public Common (ScriptName name)
while (true) {
var fNext = channel.Receive();
- yield return fNext;
+ using (fNext)
+ yield return fNext;
MessageData mdata;
try {
@@ -184,7 +185,9 @@ public Common (ScriptName name)
while (true) {
var fNext = queue.Dequeue();
- yield return fNext;
+
+ using (fNext)
+ yield return fNext;
var msg = fNext.Result;
// Result intentionally discarded
@@ -202,7 +205,8 @@ public Common (ScriptName name)
while (true) {
var fNext = channel.Receive();
- yield return fNext;
+ using (fNext)
+ yield return fNext;
LogPrint(process, fNext.Result.DecodeAsciiZ());
@@ -222,7 +226,7 @@ public Common (ScriptName name)
logText = String.Format("{0:HH:mm:ss}: {1}", DateTime.Now, text);
Log.Add(logText);
- Console.WriteLine(logText);
+ Console.WriteLine(logText.Replace('\0', ' '));
if (LogWindowInstance != null)
LogWindowInstance.AddLine(logText);
}
@@ -240,7 +244,8 @@ public Common (ScriptName name)
while (true) {
var fNext = channel.Receive();
- yield return fNext;
+ using (fNext)
+ yield return fNext;
object[] callTuple = serializer.Deserialize<object[]>(fNext.Result.DecodeAsciiZ());
string scriptName = callTuple[0] as string;
4 GoonfleetGateway/GoonfleetGateway.cs
View
@@ -85,7 +85,9 @@ public GoonfleetGateway (ScriptName name)
while (true) {
var nextItem = Queue.Dequeue();
- yield return nextItem;
+
+ using (nextItem)
+ yield return nextItem;
yield return sleep;
4 JabberGateway/JabberGateway.cs
View
@@ -226,7 +226,9 @@ public class Endpoint : IDisposable {
while (true) {
var f = Queue.Dequeue();
- yield return f;
+
+ using (f)
+ yield return f;
if (pendingSend != null)
yield return pendingSend;
Please sign in to comment.
Something went wrong with that request. Please try again.