!8 fix sender_seen memory leak
From: @zhuofeng6 Reviewed-by: @gaoruoshu Signed-off-by: @gaoruoshu
This commit is contained in:
commit
a6029ae0dd
48
huawei-fix-sender_seen-memory-leak.patch
Normal file
48
huawei-fix-sender_seen-memory-leak.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
From 48c8032695fedbd92bb24a2c2d4c3a4d83732409 Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhuofeng <zhuofeng2@huawei.com>
|
||||||
|
Date: Mon, 6 Mar 2023 15:19:06 +0800
|
||||||
|
Subject: [PATCH] fix sender_seen memory leak
|
||||||
|
|
||||||
|
---
|
||||||
|
slip/dbus/service.py | 17 +++++++++--------
|
||||||
|
1 file changed, 9 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/slip/dbus/service.py b/slip/dbus/service.py
|
||||||
|
index 5d276f8..bf4cb77 100644
|
||||||
|
--- a/slip/dbus/service.py
|
||||||
|
+++ b/slip/dbus/service.py
|
||||||
|
@@ -224,11 +224,12 @@ class Object(with_metaclass(InterfaceType, dbus.service.Object)):
|
||||||
|
if not new_owner and (old_owner, conn) in Object.senders:
|
||||||
|
Object.senders.remove((old_owner, conn))
|
||||||
|
Object.connections_senders[conn].remove(old_owner)
|
||||||
|
+ if old_owner in Object.connections_smobjs:
|
||||||
|
+ Object.connections_smobjs[old_owner].remove()
|
||||||
|
+ del Object.connections_smobjs[old_owner]
|
||||||
|
|
||||||
|
if len(Object.connections_senders[conn]) == 0:
|
||||||
|
- Object.connections_smobjs[conn].remove()
|
||||||
|
del Object.connections_senders[conn]
|
||||||
|
- del Object.connections_smobjs[conn]
|
||||||
|
|
||||||
|
if not self.persistent and len(Object.senders) == 0 and \
|
||||||
|
Object.current_source is None:
|
||||||
|
@@ -251,10 +252,10 @@ class Object(with_metaclass(InterfaceType, dbus.service.Object)):
|
||||||
|
Object.senders.add((sender, self.connection))
|
||||||
|
if self.connection not in Object.connections_senders:
|
||||||
|
Object.connections_senders[self.connection] = set()
|
||||||
|
- Object.connections_smobjs[self.connection] = \
|
||||||
|
- self.connection.add_signal_receiver(
|
||||||
|
- handler_function=self._name_owner_changed,
|
||||||
|
- signal_name='NameOwnerChanged',
|
||||||
|
- dbus_interface='org.freedesktop.DBus',
|
||||||
|
- arg1=sender)
|
||||||
|
+ Object.connections_smobjs[sender] = \
|
||||||
|
+ self.connection.add_signal_receiver(
|
||||||
|
+ handler_function=self._name_owner_changed,
|
||||||
|
+ signal_name='NameOwnerChanged',
|
||||||
|
+ dbus_interface='org.freedesktop.DBus',
|
||||||
|
+ arg1=sender)
|
||||||
|
Object.connections_senders[self.connection].add(sender)
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -1,11 +1,13 @@
|
|||||||
Name: python-slip
|
Name: python-slip
|
||||||
Version: 0.6.5
|
Version: 0.6.5
|
||||||
Release: 5
|
Release: 6
|
||||||
Summary: Library for Python 2.x with Convenience, extension and workaround
|
Summary: Library for Python 2.x with Convenience, extension and workaround
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://github.com/nphilipp/%{name}
|
URL: https://github.com/nphilipp/%{name}
|
||||||
Source0: https://github.com/nphilipp/%{name}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2
|
Source0: https://github.com/nphilipp/%{name}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2
|
||||||
|
|
||||||
|
Patch9000: huawei-fix-sender_seen-memory-leak.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: python3 python3-devel
|
BuildRequires: python3 python3-devel
|
||||||
|
|
||||||
@ -27,7 +29,7 @@ Obsoletes: python3-slip-dbus
|
|||||||
Slip for Python 3.x packages
|
Slip for Python 3.x packages
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup
|
%autosetup -n %{name}-%{version} -p1
|
||||||
|
|
||||||
find . -name '*.py' -o -name '*.py.in' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
find . -name '*.py' -o -name '*.py.in' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
||||||
|
|
||||||
@ -49,6 +51,12 @@ find . -name '*.py' -o -name '*.py.in' | xargs sed -i '1s|^#!python|#!%{__pyth
|
|||||||
%{python3_sitelib}/slip*-%{version}-py%{python3_version}.egg-info
|
%{python3_sitelib}/slip*-%{version}-py%{python3_version}.egg-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Mar 14 2023 zhuofeng <zhuofeng@huawei.com> - 0.6.5-6
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:fix sender_seen memory leak
|
||||||
|
|
||||||
* Wed Nov 4 2020 wangjie<wangjie294@huawei.com> -0.6.5-5
|
* Wed Nov 4 2020 wangjie<wangjie294@huawei.com> -0.6.5-5
|
||||||
- Type:NA
|
- Type:NA
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user