* Destroy performs some security checks, securely wipes the contents of, and then releases a Buffer's memory back to the OS. If a security check fails, the process will attempt to wipe all it can before safely panicking. If the Buffer has already been destroyed, the function does nothing and return
()
| 178 | If the Buffer has already been destroyed, the function does nothing and returns nil. |
| 179 | */ |
| 180 | func (b *Buffer) Destroy() { |
| 181 | if err := b.destroy(); err != nil { |
| 182 | Panic(err) |
| 183 | } |
| 184 | // Remove this one from global slice. |
| 185 | buffers.remove(b) |
| 186 | } |
| 187 | |
| 188 | func (b *Buffer) destroy() error { |
| 189 | if b == nil { |