peony: fix segmentaion fault when rapidly open windows by mouse clicks

Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
This commit is contained in:
侯红勋 2024-04-15 14:06:22 +08:00
parent 63fa727148
commit d5f9dcca4a
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From e996788ca2bd34d1621d081b99eb6cd7646e931c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= <houhongxun@kylinos.cn>
Date: Mon, 15 Apr 2024 11:37:10 +0800
Subject: [PATCH] peony: fix segment fault when rapidly open windows
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
---
src/windows/main-window.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/windows/main-window.cpp b/src/windows/main-window.cpp
index a010fcf..26840cd 100644
--- a/src/windows/main-window.cpp
+++ b/src/windows/main-window.cpp
@@ -833,6 +833,9 @@ void MainWindow::updateWindowIcon()
void MainWindow::goToUri(const QString &uri, bool addHistory, bool force)
{
+ if (!getCurrentPage() || !getCurrentPage()->getView())
+ return;
+
auto viewId = this->getCurrentPage()->getView()->viewId();
if (QString::compare(viewId, "Icon View", Qt::CaseSensitive) == 0) {
--
2.43.0

View File

@ -1,11 +1,12 @@
Name: peony
Version: 3.10.0
Release: 3
Release: 4
Summary: file Manager for the UKUI desktop
License: GPL-3.0-or-later and MIT and BSD-3-Clause
URL: http://www.ukui.org
Source0: %{name}-%{version}.tar.gz
Patch01: 0001-fix-share-error-of-peony.patch
Patch02: 0001-peony-fix-segment-fault-when-rapidly-open-windows.patch
BuildRequires: libudisks2-devel
BuildRequires: libnotify-devel
@ -79,6 +80,7 @@ Provides: libpeony
%prep
%setup -q
%patch01 -p1
%patch02 -p1
%build
%{qmake_qt5}
@ -135,6 +137,9 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/%{_lib}/*.so
%changelog
* Mon Apr 15 2024 houhongxun <houhongxun@kylinos.cn> - 3.10.0-4
- fix segmentation fault when rapidly open windows by mouse clicks
* Tue Jun 06 2023 peijiankang <peijiankang@kylinos.cn> - 3.10.0-3
- fix share error of peony