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:
6
item.go
6
item.go
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user