Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
0ab95f215e
!10 [sync] PR-9: fix sender_seen memory leak
From: @openeuler-sync-bot 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
2023-08-09 08:52:24 +00:00
zhuofeng
05249ae363 fix sender_seen memory leak
(cherry picked from commit 0d6d8eef36dd44d15dd4394f49732e48c55f14fb)
2023-08-08 10:26:26 +08:00
openeuler-ci-bot
a2f0304998
!6 【轻量级 PR】:Rebuild for next release
From: @zhangruifang2020 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
2022-11-01 09:01:17 +00:00
张瑞方
3223a3abc0
Rebuild for next release
Signed-off-by: 张瑞方 <xdzhangruifang@163.com>
2022-10-27 02:35:29 +00:00
openeuler-ci-bot
7034ad6a47 !5 remove python2
From: @jlwwlsqc
Reviewed-by: 
Signed-off-by:
2020-11-05 10:43:27 +08:00
openeuler-ci-bot
0d7f287d9a remove python2
Merge pull request !2 from Markeryang/master
2020-11-05 10:04:57 +08:00
openeuler-ci-bot
9e09ad318d !2 add yaml file in package
Merge pull request !2 from Markeryang/master
2020-06-28 11:46:32 +08:00
Markeryang
c20e69c308 add python-slip.yaml. 2020-06-24 16:53:32 +08:00
openeuler-ci-bot
f34849696e !1 provides python2-slip-dbus
Merge pull request !1 from lvying6/dev
2020-01-11 15:06:34 +08:00
lvying6
a532cb3979 provides python2-slip-dbus 2020-01-11 10:30:11 +08:00
3 changed files with 76 additions and 50 deletions

View 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

View File

@ -1,31 +1,21 @@
Name: python-slip Name: python-slip
Version: 0.6.5 Version: 0.6.5
Release: 3 Release: 7
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: python2 python2-devel python3 python3-devel BuildRequires: python3 python3-devel
%description %description
The Simple Library for Python 2.x and Python 3.x packages contain The Simple Library for Python 2.x and Python 3.x packages contain
miscellaneous code for convenience, extension and workaround purposes. miscellaneous code for convenience, extension and workaround purposes.
This package provides the "slip" and the "slip.util" modules. This package provides the "slip" and the "slip.util" modules.
%package -n python2-slip
Summary: Convenience, extension and workaround code for Python 2.x
Requires: python2-libselinux python2-six python2-decorator
Requires: python2-slip = %{version}-%{release}
Requires: python2-dbus >= 0.80
%{?python_provide:%python_provide python2-slip}
%{?python_provide:%python_provide python2-slip-dbus}
Obsoletes: python2-slip-dbus
%description -n python2-slip
Slip for Python 2.x packages
%package -n python3-slip %package -n python3-slip
Summary: Convenience, extension and workaround code for Python 3.x Summary: Convenience, extension and workaround code for Python 3.x
Requires: python3-libselinux python3-decorator python3-six Requires: python3-libselinux python3-decorator python3-six
@ -38,46 +28,16 @@ Obsoletes: python3-slip-dbus
%description -n python3-slip %description -n python3-slip
Slip for Python 3.x packages Slip for Python 3.x packages
%package -n python2-slip-gtk
Summary: Code to make auto-wrapping gtk labels
Requires: python2-slip = %{version}-%{release}
Requires: pygtk2
%{?python_provide:%python_provide python2-slip-gtk}
%description -n python2-slip-gtk
Auto-wrapping function for Python 2.x packages
%prep %prep
%autosetup %autosetup -n %{name}-%{version} -p1
rm -rf %{py3dir} find . -name '*.py' -o -name '*.py.in' | xargs sed -i '1s|^#!python|#!%{__python3}|'
cp -a . %{py3dir}
find %{py3dir} -name '*.py' -o -name '*.py.in' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%build %build
%make_build PYTHON=%{__python2}
cd %{py3dir}
%make_build PYTHON=%{__python3} %make_build PYTHON=%{__python3}
cd ..
%install %install
%make_install PYTHON=%{__python2}
cd %{py3dir}
%make_install PYTHON=%{__python3} %make_install PYTHON=%{__python3}
cd ..
%files -n python2-slip
%doc doc/dbus
%license COPYING
%dir %{python2_sitelib}/slip/
%{python2_sitelib}/slip/__init__.py*
%{python2_sitelib}/slip/util
%{python2_sitelib}/slip/_wrappers
%{python2_sitelib}/slip/dbus
%{python2_sitelib}/slip*-%{version}-py%{python2_version}.egg-info
%exclude %{python2_sitelib}/slip.gtk-%{version}-py%{python2_version}.egg-info
%files -n python3-slip %files -n python3-slip
%doc doc/dbus %doc doc/dbus
@ -90,11 +50,25 @@ cd ..
%{python3_sitelib}/slip/dbus %{python3_sitelib}/slip/dbus
%{python3_sitelib}/slip*-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/slip*-%{version}-py%{python3_version}.egg-info
%files -n python2-slip-gtk
%{python2_sitelib}/slip/gtk
%{python2_sitelib}/slip.gtk-%{version}-py%{python2_version}.egg-info
%changelog %changelog
* Tue Mar 14 2023 zhuofeng <zhuofeng@huawei.com> - 0.6.5-7
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix sender_seen memory leak
* Thu Oct 27 2022 zhangruifang <zhangruifang1@h-partners.com> - 0.6.5-6
- Rebuild for next release
* Wed Nov 4 2020 wangjie<wangjie294@huawei.com> -0.6.5-5
- Type:NA
- ID:NA
- SUG:NA
- DESC:remove python2
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.6.5-4
- provides python2-slip-dbus
* Fri Oct 18 2019 Yufa Fang <fangyufa1@huawei.com> - 0.6.5-3 * Fri Oct 18 2019 Yufa Fang <fangyufa1@huawei.com> - 0.6.5-3
- Type:bugfix - Type:bugfix
- ID:NA - ID:NA

4
python-slip.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: nphilipp/python-slip
tag_prefix: ^python-slip-
seperator: .