remove room without listeners from Notifier.room_to_user_streams (#18380)
Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
This commit is contained in:
parent
44ae5362fd
commit
0afdc0fc7f
1
changelog.d/18380.misc
Normal file
1
changelog.d/18380.misc
Normal file
@ -0,0 +1 @@
|
||||
Fix a memory leak in `_NotifierUserStream`.
|
||||
@ -158,6 +158,9 @@ class _NotifierUserStream:
|
||||
lst = notifier.room_to_user_streams.get(room, set())
|
||||
lst.discard(self)
|
||||
|
||||
if not lst:
|
||||
notifier.room_to_user_streams.pop(room, None)
|
||||
|
||||
notifier.user_to_user_stream.pop(self.user_id)
|
||||
|
||||
def count_listeners(self) -> int:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user