aboutsummaryrefslogtreecommitdiffstats
path: root/idatui/pool.py
diff options
context:
space:
mode:
authorDuncan Ogilvie <mr.exodia.tpodt@gmail.com>2026-08-20 23:42:42 +0200
committerDuncan Ogilvie <mr.exodia.tpodt@gmail.com>2026-08-20 23:42:42 +0200
commitf3715d8de0d255c8b14710acfa120ccb9ea953fd (patch)
tree98e79826e4e39e2269b59ccf33fa7c00a1c68c23 /idatui/pool.py
parentAdd Ctrl+R to refresh all views (diff)
downloadida-tui-f3715d8de0d255c8b14710acfa120ccb9ea953fd.tar.gz
ida-tui-f3715d8de0d255c8b14710acfa120ccb9ea953fd.tar.xz
ida-tui-f3715d8de0d255c8b14710acfa120ccb9ea953fd.zip
Adopt idb_events and remote module features from ida-codemode
Diffstat (limited to 'idatui/pool.py')
-rw-r--r--idatui/pool.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/idatui/pool.py b/idatui/pool.py
index 465dff2..573aa75 100644
--- a/idatui/pool.py
+++ b/idatui/pool.py
@@ -225,6 +225,28 @@ class DatabasePool:
self.evict(label, save=save, save_gui=save)
self.active = None
+ def discard_changes(self, labels: list[str]) -> list[str]:
+ """Discard final managed sessions; return labels whose owner remains.
+
+ A returned label is not an error: its client is attached to a GUI or a
+ still-shared worker, so releasing our lease transfers finalization to
+ that session's owner or remaining clients.
+ """
+ transferred: list[str] = []
+ for label in labels:
+ client = self._clients.get(label)
+ if client is not None and not client.discard_database():
+ transferred.append(label)
+ return transferred
+
+ def replace_client(self, label: str, old, new) -> bool:
+ """Replace one disconnected lease without changing residency policy."""
+ if self._clients.get(label) is not old:
+ return False
+ self._clients[label] = new
+ self._touch(label)
+ return True
+
# -- introspection ------------------------------------------------------ #
def status(self) -> list[dict]:
"""Per-binary residency for the switcher UI."""