Skip to content

Commit c0c564c

Browse files
SkarsnikYoshiRulz
authored andcommitted
Small fix for crashing log window when written from other thread
For some reason, changing this code to this makes it stop crashing when writing to the console from another thread. The value from `_lines.Count` was not the same in `virtualListView1.VirtualListSize`, maybe write to VirtuListSize are delayed?
1 parent 997cc59 commit c0c564c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/BizHawk.Client.EmuHawk/LogWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private void append(string str, bool invoked)
103103
private void doUpdateListSize()
104104
{
105105
virtualListView1.VirtualListSize = _lines.Count;
106-
virtualListView1.EnsureVisible(_lines.Count - 1);
106+
virtualListView1.EnsureVisible(virtualListView1.VirtualListSize - 1);
107107
}
108108

109109
private void appendInvoked(string str)
@@ -218,3 +218,4 @@ public override void Write(char[] buffer, int offset, int count)
218218
}
219219
}
220220
}
221+

0 commit comments

Comments
 (0)