Debugger: Always remove identical labels before adding a new one
This commit is contained in:
parent
7e3da8d1bf
commit
9120ac35a9
1 changed files with 6 additions and 0 deletions
|
@ -99,6 +99,12 @@ namespace Mesen.GUI.Debugger
|
|||
|
||||
public static bool SetLabel(UInt32 address, AddressType type, string label, string comment, bool raiseEvent = true)
|
||||
{
|
||||
if(_reverseLookup.ContainsKey(label)) {
|
||||
//Another identical label exists, we need to remove it
|
||||
CodeLabel existingLabel = _reverseLookup[label];
|
||||
DeleteLabel(existingLabel.Address, existingLabel.AddressType, false);
|
||||
}
|
||||
|
||||
string key = GetKey(address, type);
|
||||
if(_labels.ContainsKey(key)) {
|
||||
_reverseLookup.Remove(_labels[key].Label);
|
||||
|
|
Loading…
Add table
Reference in a new issue