Skip to content

Commit 600e7ad

Browse files
committed
Fix logger memory exhaustion
Signed-off-by: Sebastiano Mariani <[email protected]>
1 parent fc9898a commit 600e7ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

qiling/log.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import logging
88
import os
99
import re
10+
import weakref
1011

1112
from typing import Optional, TextIO
1213

@@ -38,7 +39,7 @@ class QlBaseFormatter(logging.Formatter):
3839

3940
def __init__(self, ql, *args, **kwargs):
4041
super().__init__(*args, **kwargs)
41-
self.ql = ql
42+
self.ql = weakref.ref(ql)
4243

4344
def get_level_tag(self, level: str) -> str:
4445
return self.__level_tag[level]

0 commit comments

Comments
 (0)