fix memory leak when generation fails

This commit is contained in:
AUTOMATIC1111
2023-07-31 22:01:53 +03:00
parent 0d577aba26
commit c10633f93a
3 changed files with 10 additions and 3 deletions

View File

@@ -14,7 +14,8 @@ def record_exception():
if exception_records and exception_records[-1] == e:
return
exception_records.append((e, tb))
from modules import sysinfo
exception_records.append(sysinfo.format_exception(e, tb))
if len(exception_records) > 5:
exception_records.pop(0)