fix memory leak when generation fails

This commit is contained in:
AUTOMATIC1111
2023-07-31 22:01:53 +03:00
parent 56236dfd3f
commit 12171ca961
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)