1
0
mirror of https://github.com/fumiama/orbyte.git synced 2026-06-12 22:40:54 +08:00

fix(pbuf): destroy misuse

This commit is contained in:
源文雨
2025-02-25 16:50:06 +09:00
parent 224f488d8e
commit 309b51a50e
8 changed files with 280 additions and 51 deletions

View File

@@ -120,11 +120,7 @@ func (b *Item[T]) setautodestroy() *Item[T] {
if item.stat.hasdestroyed() {
panic("unexpected hasdestroyed")
}
if !item.stat.isintrans() && item.stat.isbuffered() {
item.pool.pooler.Reset(&item.val)
}
item.stat.setdestroyed(true)
item.pool.put(item)
item.destroybystat(item.stat)
})
return b
}