diff --git a/src/remote/codec.cpp b/src/remote/codec.cpp index cffe3fe..67bb701 100644 --- a/src/remote/codec.cpp +++ b/src/remote/codec.cpp @@ -1138,6 +1138,9 @@ namespace epics { // clean resources internalClose(true); + // this is important to avoid cyclic refs (memory leak) + clearSendQueue(); + _sendQueue.wakeup(); // post close diff --git a/src/remote/codec.h b/src/remote/codec.h index 3c36f54..9bfa24f 100644 --- a/src/remote/codec.h +++ b/src/remote/codec.h @@ -168,6 +168,11 @@ namespace epics { } } + size_t size() { + epics::pvData::Lock lock(_queueMutex); + return _queue.size(); + } + private: std::deque _queue;