destructor based seqs: bugfix
This commit is contained in:
parent
ec66fd07cb
commit
9563be37d3
1 changed files with 2 additions and 1 deletions
|
|
@ -43,7 +43,8 @@ proc `=destroy`[T](s: var seq[T]) =
|
|||
mixin `=destroy`
|
||||
when not supportsCopyMem(T):
|
||||
for i in 0..<x.len: `=destroy`(p.data[i])
|
||||
p.region.dealloc(p.region, p, payloadSize(p.cap))
|
||||
if p.region != nil:
|
||||
p.region.dealloc(p.region, p, payloadSize(p.cap))
|
||||
x.p = nil
|
||||
x.len = 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue