!16 [sync] PR-15: 修复coredump问题

From: @openeuler-sync-bot 
Reviewed-by: @ut-layne-yang 
Signed-off-by: @ut-layne-yang
This commit is contained in:
openeuler-ci-bot 2024-12-23 05:41:38 +00:00 committed by Gitee
commit 05b7652280
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 47 additions and 2 deletions

View File

@ -0,0 +1,41 @@
From 669ef44f4f9ee32336b34eaa3b31869ce8a5bfc7 Mon Sep 17 00:00:00 2001
From: lvgenggeng <lvgenggeng@uniontech.com>
Date: Wed, 11 Dec 2024 19:44:05 +0800
Subject: [PATCH 1/1] fix coredump in clearChildLayout function
Signed-off-by: lvgenggeng <lvgenggeng@uniontech.com>
---
.../private/cattributemanagerwgt.cpp | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/frame/AttributesWidgets/private/cattributemanagerwgt.cpp b/src/frame/AttributesWidgets/private/cattributemanagerwgt.cpp
index e706984..0adaab5 100644
--- a/src/frame/AttributesWidgets/private/cattributemanagerwgt.cpp
+++ b/src/frame/AttributesWidgets/private/cattributemanagerwgt.cpp
@@ -161,18 +161,13 @@ Qt::Alignment CExpWgt::widgetAlignInWindow(const QWidget *w)
void CExpWgt::clearChildLayout()
{
- for (int i = 0; i < _pCenterLay->count();) {
- auto item = _pCenterLay->itemAt(i);
-
- if (item->layout() != nullptr) {
- delete item->layout();
- } else if (item->widget() != nullptr) {
- if (qobject_cast<CSpline *>(item->widget()) != nullptr) {
- item->widget()->deleteLater();
- }
+ while (_pCenterLay->count() > 0) {
+ QLayoutItem *pItem = _pCenterLay->takeAt(0);
+ if (nullptr != pItem) {
+ delete pItem;
}
- _pCenterLay->takeAt(i);
}
+
foreach (auto p, _splines) {
p->deleteLater();
}
--
2.20.1

View File

@ -1,10 +1,11 @@
Name: deepin-draw Name: deepin-draw
Version: 5.10.6 Version: 5.10.6
Release: 1 Release: 2
Summary: A lightweight drawing tool for Linux Deepin Summary: A lightweight drawing tool for Linux Deepin
License: GPLv3+ License: GPLv3+
URL: https://github.com/linuxdeepin/%{name} URL: https://github.com/linuxdeepin/%{name}
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-fix-coredump-in-clearChildLayout-function.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -29,7 +30,7 @@ Recommends: deepin-manual
%{summary}. %{summary}.
%prep %prep
%autosetup %autosetup -p1
%build %build
# help find (and prefer) qt5 utilities, e.g. qmake, lrelease # help find (and prefer) qt5 utilities, e.g. qmake, lrelease
@ -60,6 +61,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
%{_datadir}/mime/packages/deepin-draw.xml %{_datadir}/mime/packages/deepin-draw.xml
%changelog %changelog
* Wed Dec 11 2024 lvgenggeng <lvgenggeng@uniontech.com> - 5.10.6-2
- fix: fix coredump in clearChildLayout function
* Wed May 17 2023 leeffo <liweiganga@uniontech.com> - 5.10.6-1 * Wed May 17 2023 leeffo <liweiganga@uniontech.com> - 5.10.6-1
- update to 5.10.6 - update to 5.10.6