ram watch: watches are deleted by index
If you have two watches with an identical address, deleting one will always delete the first one. This commit fixes that
This commit is contained in:
parent
c13430896f
commit
d6994ea1af
|
@ -741,14 +741,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void RemoveWatchMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var items = SelectedItems.ToList();
|
||||
if (items.Any())
|
||||
var indices = SelectedIndices
|
||||
.OrderByDescending(i => i)
|
||||
.ToList();
|
||||
if (indices.Any())
|
||||
{
|
||||
foreach (var item in items)
|
||||
foreach (var index in indices)
|
||||
{
|
||||
_watches.Remove(item);
|
||||
_watches.RemoveAt(index);
|
||||
}
|
||||
|
||||
WatchListView.RowCount = _watches.Count;
|
||||
GeneralUpdate();
|
||||
UpdateWatchCount();
|
||||
|
|
Loading…
Reference in New Issue