aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2013-06-19 17:52:03 +0200
committerJakob Odersky <jodersky@gmail.com>2013-06-19 17:52:03 +0200
commit6b00e5a097fe8edfacc08e575487a6ed360b2889 (patch)
tree50a0a1d7ee7455e077a1c0564523ae4fda450e55
parent36f51c969f2a0bbcda6bb740d8c1278e614adc2e (diff)
downloadakka-serial-6b00e5a097fe8edfacc08e575487a6ed360b2889.tar.gz
akka-serial-6b00e5a097fe8edfacc08e575487a6ed360b2889.tar.bz2
akka-serial-6b00e5a097fe8edfacc08e575487a6ed360b2889.zip
fix crash issue on close, due to closing the port twice
-rw-r--r--samples/src/main/scala/com/github/jodersky/flow/example/Main.scala3
-rw-r--r--src/main/scala/com/github/jodersky/flow/SerialOperator.scala1
2 files changed, 2 insertions, 2 deletions
diff --git a/samples/src/main/scala/com/github/jodersky/flow/example/Main.scala b/samples/src/main/scala/com/github/jodersky/flow/example/Main.scala
index c25270b..021f638 100644
--- a/samples/src/main/scala/com/github/jodersky/flow/example/Main.scala
+++ b/samples/src/main/scala/com/github/jodersky/flow/example/Main.scala
@@ -35,7 +35,8 @@ object Main {
serial ! ByteString(42)
readLine()
- //serial ! Close
+ serial ! "close"
+ readLine()
system.shutdown()
}
diff --git a/src/main/scala/com/github/jodersky/flow/SerialOperator.scala b/src/main/scala/com/github/jodersky/flow/SerialOperator.scala
index aa320e1..51cef39 100644
--- a/src/main/scala/com/github/jodersky/flow/SerialOperator.scala
+++ b/src/main/scala/com/github/jodersky/flow/SerialOperator.scala
@@ -42,7 +42,6 @@ class SerialOperator(serial: LowSerial, handler: ActorRef) extends Actor {
}
case Close => {
- serial.close()
sender ! Closed
context.stop(self)
}