peony/0001-peony-fix-segment-fault-when-rapidly-open-windows.patch
侯红勋 d5f9dcca4a peony: fix segmentaion fault when rapidly open windows by mouse clicks
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
2024-04-15 14:06:22 +08:00

31 lines
991 B
Diff

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