mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-08 22:36:49 +02:00
Fix race condition when starting several command tasks in quick succession
See https://github.com/jesseduffield/lazygit/issues/4507 for an elaborate description.
This commit is contained in:
@ -373,8 +373,6 @@ func (self *ViewBufferManager) NewTask(f func(TaskOpts) error, key string) error
|
|||||||
go utils.Safe(func() {
|
go utils.Safe(func() {
|
||||||
defer completeGocuiTask()
|
defer completeGocuiTask()
|
||||||
|
|
||||||
self.readLines = nil
|
|
||||||
|
|
||||||
self.taskIDMutex.Lock()
|
self.taskIDMutex.Lock()
|
||||||
self.newTaskID++
|
self.newTaskID++
|
||||||
taskID := self.newTaskID
|
taskID := self.newTaskID
|
||||||
@ -400,6 +398,8 @@ func (self *ViewBufferManager) NewTask(f func(TaskOpts) error, key string) error
|
|||||||
self.stopCurrentTask()
|
self.stopCurrentTask()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.readLines = nil
|
||||||
|
|
||||||
stop := make(chan struct{})
|
stop := make(chan struct{})
|
||||||
notifyStopped := make(chan struct{})
|
notifyStopped := make(chan struct{})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user