summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CSharp/Ivy/IvyPPC/IvyClient.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyClient.cs b/CSharp/Ivy/IvyPPC/IvyClient.cs
index dbf8ef1..31ccdd5 100644
--- a/CSharp/Ivy/IvyPPC/IvyClient.cs
+++ b/CSharp/Ivy/IvyPPC/IvyClient.cs
@@ -265,12 +265,14 @@ namespace IvyBus
return ;
// Tell Thread to stop.
running = false;
- in_stream.Close();
+ if ( in_stream != null )
+ in_stream.Close();
if ( Thread.CurrentThread != clientThread )
{
// Wait for Thread to end.
clientThread.Join();
}
+
clientThread = null;
}