Skip to content

Commit d0f2601

Browse files
committed
Fix a race condition with error windows
Fixes rjkroege#57: we lookup a window in `edwood/util.go:66`. It's happy to find a window from `g.row` while `g.row` is locked and that window struct can be invalid at the time during a `del()` action. So lock the row/column struct while obtaining the window object.
1 parent 6d0d50f commit d0f2601

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xfid.go

+2
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,9 @@ func xfidwrite(x *Xfid) {
433433
//x.fcall.Data[x.fcall.Count] = 0; // null-terminate. unneeded
434434
switch qid {
435435
case Qcons:
436+
global.row.lk.Lock()
436437
w = errorwin(x.f.mntdir, 'X')
438+
global.row.lk.Unlock()
437439
updateText(&w.body)
438440

439441
case Qlabel:

0 commit comments

Comments
 (0)