Skip to content

Commit 105cf06

Browse files
authored
Merge pull request #1161 from Phat3/fix/log_mem_exhaustion
Fix memory exhaustion problem caused by the logger
2 parents fc9898a + d2df83b commit 105cf06

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.proxy(ql)
4243

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

0 commit comments

Comments
 (0)