diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-31 19:01:53 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-31 19:03:05 +0000 |
commit | c10633f93a646b06f62bf1b24adba52f539dd6b6 (patch) | |
tree | 64f3f80158700f24f8f6126f7a35b8ce3f700da3 /modules/sysinfo.py | |
parent | 0d577aba26c6eb3b47c6dbef6605830d26c375ed (diff) | |
download | stable-diffusion-webui-gfx803-c10633f93a646b06f62bf1b24adba52f539dd6b6.tar.gz stable-diffusion-webui-gfx803-c10633f93a646b06f62bf1b24adba52f539dd6b6.tar.bz2 stable-diffusion-webui-gfx803-c10633f93a646b06f62bf1b24adba52f539dd6b6.zip |
fix memory leak when generation fails
Diffstat (limited to 'modules/sysinfo.py')
-rw-r--r-- | modules/sysinfo.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/sysinfo.py b/modules/sysinfo.py index 5f15ac4f..cf24c6dd 100644 --- a/modules/sysinfo.py +++ b/modules/sysinfo.py @@ -109,11 +109,15 @@ def format_traceback(tb): return [[f"{x.filename}, line {x.lineno}, {x.name}", x.line] for x in traceback.extract_tb(tb)]
+def format_exception(e, tb):
+ return {"exception": str(e), "traceback": format_traceback(tb)}
+
+
def get_exceptions():
try:
from modules import errors
- return [{"exception": str(e), "traceback": format_traceback(tb)} for e, tb in reversed(errors.exception_records)]
+ return list(reversed(errors.exception_records))
except Exception as e:
return str(e)
|