lichao
2021-03-25 d3e7f93e69cb24c766292d8780e745caf24d42a8
src/shm_queue.cpp
@@ -73,7 +73,9 @@
        if (Send(remote_id, msg, timeout_ms)) {
            return true;
        } else {
            if (msg.RemoveRef() == 0) { // works for both refcounted and not counted.
            msg.FreeFrom(shm());
            }
        }
    }
    return false;
@@ -83,9 +85,10 @@
{
    Msg msg;
    if (Read(msg, timeout_ms)) {
        DEFER1(if (msg.RemoveRef() == 0) { msg.FreeFrom(shm()); });
        auto ptr = msg.get<char>();
        if (ptr) {
            DEFER1(shm().Dealloc(ptr););
            MsgMetaV1 meta;
            meta.Parse(ptr);
            source_id = meta.src_id_;