From 5e71e9c0d9bba9b2c99cf1b1681a9ecaae887cf8 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 13 Oct 2016 21:18:48 +0100 Subject: [PATCH] Another silly bug. --- P25Gateway/P25Gateway.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/P25Gateway/P25Gateway.cpp b/P25Gateway/P25Gateway.cpp index a4b9546..582114e 100644 --- a/P25Gateway/P25Gateway.cpp +++ b/P25Gateway/P25Gateway.cpp @@ -275,15 +275,16 @@ void CP25Gateway::run() if (dstId == 9999U || reflector != NULL) { std::string callsign = lookup->find(srcId); LogMessage("Unlinked from reflector %u by %s", currentId, callsign.c_str()); - currentId = dstId; - if (remoteNetwork != NULL) { + if (remoteNetwork != NULL && currentId != 9999U) { remoteNetwork->writeUnlink(currentAddr, currentPort); remoteNetwork->writeUnlink(currentAddr, currentPort); remoteNetwork->writeUnlink(currentAddr, currentPort); pollTimer.stop(); lostTimer.stop(); } + + currentId = dstId; } // Link to the new reflector