drop data if not use

This commit is contained in:
Jay 2018-10-10 00:19:33 +08:00
parent 4fe7bcbc43
commit bacfa52696

View File

@ -350,6 +350,15 @@ func lottery(sub, txt string, s *lineobj.SourceObject) (res string) {
for idx, val := range perm { for idx, val := range perm {
dest[val] = arr[idx] dest[val] = arr[idx]
} }
defer func() {
for i := range perm {
dest[i] = nil
arr[i] = nil
}
dest = nil
arr = nil
perm = nil
}()
data := dest[0] data := dest[0]