summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-12-02 19:25:10 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-12-07 17:53:03 +0900
commit5352d7bacb4f3f59c315a35e990d57fd3d52466d (patch)
tree3455a2c0541108e8245d10020be7474edb966935 /src
parent85bc237c684310a69fd3d05bb0124f7e100b5216 (diff)
downloadbuildstream-5352d7bacb4f3f59c315a35e990d57fd3d52466d.tar.gz
_stream.py: Centralize application state cleanup
Instead of delegating this job to a Project instance, implement the application state cleanup directly on the Stream object. This commit also: * Removes Project.cleanup() * Reword incorrect API documentation for Element._reset_load_state()
Diffstat (limited to 'src')
-rw-r--r--src/buildstream/_project.py8
-rw-r--r--src/buildstream/_stream.py4
-rw-r--r--src/buildstream/element.py3
3 files changed, 3 insertions, 12 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index 180c23977..fd4a44732 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -485,14 +485,6 @@ class Project:
self._load_second_pass()
- # cleanup()
- #
- # Cleans up resources used loading elements
- #
- def cleanup(self):
- # Reset the element loader state
- Element._reset_load_state()
-
# get_default_target()
#
# Attempts to interpret which element the user intended to run a command on.
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 222957c02..fc5b15211 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -111,8 +111,8 @@ class Stream:
# Cleans up application state
#
def cleanup(self):
- if self._project:
- self._project.cleanup()
+ # Reset the element loader state
+ Element._reset_load_state()
# set_project()
#
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index efec5e714..3ac201d66 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1194,8 +1194,7 @@ class Element(Plugin):
# _reset_load_state()
#
- # This is called by Pipeline.cleanup() and is used to
- # reset the loader state between multiple sessions.
+ # This is used to reset the loader state across multiple load sessions.
#
@classmethod
def _reset_load_state(cls):