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