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