Fix the crash on changing network settings, and apply resynced contacts in batches
ApplyNetworkSettings disposed the station link without clearing it, so ApplyStationLinkSettings disposed it a second time and threw. Only the second function touches the link now, and StationLink.Dispose can be called twice. Contacts from the network are queued and applied together on the window thread. Each one used to rescore the whole log and redraw the log window, which kept the window thread busy for minutes during a resync. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -127,12 +127,28 @@ public sealed class ContestLog
|
||||
Rebuild();
|
||||
}
|
||||
|
||||
/// `Insert` for several contacts, scoring the log once instead of once per
|
||||
/// contact. A resync sends a few hundred in a burst.
|
||||
public void InsertRange(IEnumerable<Qso> arrived)
|
||||
{
|
||||
qsos.AddRange(arrived);
|
||||
Rebuild();
|
||||
}
|
||||
|
||||
public void Remove(string id)
|
||||
{
|
||||
qsos.RemoveAll(q => q.Id == id);
|
||||
Rebuild();
|
||||
}
|
||||
|
||||
/// `Remove` for several contacts, scoring the log once.
|
||||
public void RemoveRange(IReadOnlyCollection<string> ids)
|
||||
{
|
||||
HashSet<string> gone = [.. ids];
|
||||
qsos.RemoveAll(q => gone.Contains(q.Id));
|
||||
Rebuild();
|
||||
}
|
||||
|
||||
public void Replace(Qso qso)
|
||||
{
|
||||
int at = qsos.FindIndex(q => q.Id == qso.Id);
|
||||
|
||||
Reference in New Issue
Block a user