Skip to content

Conversation

@Skarsnik
Copy link
Contributor

@Skarsnik Skarsnik commented Oct 5, 2025

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?

Prevent crashs when writing in the console from multiple threads.

Check if completed:

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?
@YoshiRulz
Copy link
Member

YoshiRulz commented Oct 5, 2025

What pattern were you using that wasn't working with the log window? Something like new Thread(() => Console.WriteLine(...)).Start();? edit: Well CNR with that, I'll just take your word for it.

@Skarsnik
Copy link
Contributor Author

Skarsnik commented Oct 5, 2025

I have an external tool that does network stuff in its own thread. The main thread and the network thread both do some Console.Writeln().
I think my issue compared to #2694 is that I do a lot of multiline output (for example, in https://github.com/Skarsnik/Bizhawk-nwa-tool/blob/master/src/NWAServer.cs#L118 ) and if I remember correctly (sorry, I fixed this like over 6 months ago?) both _lines.Count and virtualListView1.VirtualListSize were not the same despiste the asignation.

@YoshiRulz YoshiRulz added this to the 2.11.1 milestone Oct 9, 2025
@YoshiRulz YoshiRulz added the Tool: Log Window Relating to `View` > `Open Log Window...` label Oct 9, 2025
@vadosnaprimer
Copy link
Contributor

I don't mind merging this without testing.

@YoshiRulz YoshiRulz merged commit c0c564c into TASEmulators:master Oct 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tool: Log Window Relating to `View` > `Open Log Window...`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants