Remove session listener when stopping tree cache

To better clean up the tree cache when stopping, remove the session
listener callback.  This helps avoid extra object references that
could keep the python objects from being garbage collected longer
than necessary.

Change-Id: I123624b531ca34b10394a23397dcfe932c3fa7e7
This commit is contained in:
James E. Blair
2025-02-22 09:38:50 -08:00
parent 47cb9f7b63
commit 487c6700b6

View File

@@ -138,6 +138,7 @@ class ZuulTreeCache(abc.ABC):
self._stopped = True
self._event_queue.put(None)
self._playback_queue.put(None)
self.client.remove_listener(self._sessionListener)
def _walkTree(self, root=None, seen_paths=None):
# Recursively walk the tree and emit fake changed events for