diff --git a/bcc.py b/bcc.py index dbd6110..32d8290 100644 --- a/bcc.py +++ b/bcc.py @@ -2083,12 +2083,17 @@ class MainWindow(QMainWindow): if not (0 <= idx < len(self.servers)): return entry = self.servers[idx] + old_name = entry.name entry.name = self.editor.current_name() entry.data = self.editor.dump_data() # The server stays in its section (enable state unchanged), so update # its existing row in place rather than re-rendering. # An edit invalidates any cached "Test all" result -- the server that - # was spawn-tested no longer matches what's on disk once saved. + # was spawn-tested no longer matches what's on disk once saved. Pop + # both names: the old one (so a rename doesn't leave a stale entry + # for whoever takes that name next) and the new one (so we don't + # inherit a stale result cached under the name being renamed to). + self._health.pop(old_name, None) self._health.pop(entry.name, None) loc = self._row_of_index.get(idx) if loc: