mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
actions: Fix the iteration over a slice under modification in QuitAll() (#2898)
This commit is contained in:
@@ -430,6 +430,15 @@ func NewBuffer(r io.Reader, size int64, path string, startcursor Loc, btype BufT
|
||||
return b
|
||||
}
|
||||
|
||||
// CloseOpenBuffers removes all open buffers
|
||||
func CloseOpenBuffers() {
|
||||
for i, buf := range OpenBuffers {
|
||||
buf.Fini()
|
||||
OpenBuffers[i] = nil
|
||||
}
|
||||
OpenBuffers = OpenBuffers[:0]
|
||||
}
|
||||
|
||||
// Close removes this buffer from the list of open buffers
|
||||
func (b *Buffer) Close() {
|
||||
for i, buf := range OpenBuffers {
|
||||
|
||||
Reference in New Issue
Block a user