lichao
2021-03-29 c095be83aa9d795023a54ddaccfb6717258561c9
src/msg.cpp
@@ -59,9 +59,20 @@
}
void Msg::FreeFrom(SharedMemory &shm)
int Msg::Release(SharedMemory &shm)
{
    if (IsCounted()) {
        const int n = count_->Dec();
        if (n != 0) {
            return n;
        }
    }
    // free data
    shm.Dealloc(ptr_);
    ptr_ = 0;
    shm.Delete(count_);
    count_ = 0;
    return 0;
}
} // namespace bhome_shm