Skip to content

Commit b926ac4

Browse files
Merge pull request #98 from chaoslawful/master
break reference loop using weakref to prevent memory-leaking
2 parents 6879d41 + 73ab1f1 commit b926ac4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pymysqlreplication/binlogstream.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ def close(self):
8585
self._stream_connection.close()
8686
self.__connected_stream = False
8787
if self.__connected_ctl:
88+
# break reference cycle between stream reader and underlying
89+
# mysql connection object
90+
self._ctl_connection._get_table_information = None
8891
self._ctl_connection.close()
8992
self.__connected_ctl = False
9093

0 commit comments

Comments
 (0)