Commit 5037705e authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Don't clear again if already cleared/clearing

parent cd78c69c
......@@ -45,6 +45,7 @@ class ForwardedPacketStore(var logger: Logger?) {
val forwardedPollablePackets:List<FutureAnswer> = _forwardedPollablePackets
var hasMixedAnswerType:Boolean = true
private set
private var clearing = false
fun addForwardedQuestion(token: DeviceWriteToken, socket: java.io.Closeable) {
addForwardedQuestion(SocketBasedFutureAnswer(token, socket))
......@@ -91,6 +92,8 @@ class ForwardedPacketStore(var logger: Logger?) {
@Throws(IOException::class)
fun clear(completely:Boolean = false) {
if(clearing) return
clearing = completely
logger?.fine("Clearing ForwardedPacketStore")
forwardedPollablePackets.forEach {
cleanup(it)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment