We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2fd72c commit 015fd8cCopy full SHA for 015fd8c
rleplus/env/energyplus.py
@@ -141,8 +141,17 @@ def stop(self) -> None:
141
if not self.simulation_complete:
142
self.simulation_complete = True
143
self._flush_queues()
144
- self.energyplus_exec_thread.join()
145
- self.energyplus_exec_thread = None
+
+ if self.energyplus_exec_thread:
146
+ # wait for E+ thread to finish
147
+ # in some occasions, join() raises a RuntimeError("cannot join current thread")
148
+ # this should not prevent moving forward and cleaning up
149
+ try:
150
+ self.energyplus_exec_thread.join()
151
+ except RuntimeError:
152
+ pass
153
+ self.energyplus_exec_thread = None
154
155
self.energyplus_api.runtime.clear_callbacks()
156
self.energyplus_api.state_manager.delete_state(self.energyplus_state)
157
0 commit comments