53 lines
1.5 KiB
Diff
53 lines
1.5 KiB
Diff
From 443a316ff98be2cfb1c7cdb3725489789ac504b9 Mon Sep 17 00:00:00 2001
|
|
From: peijiankang <peijiankang@kylinos.cn>
|
|
Date: Fri, 10 Feb 2023 16:48:13 +0800
|
|
Subject: [PATCH] fix coredump of ukui-menu
|
|
|
|
---
|
|
src/UserInterface/ListView/klistview.cpp | 12 +++++++++---
|
|
src/UserInterface/ListView/listview.cpp | 5 ++++-
|
|
2 files changed, 13 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp
|
|
index 012b52a..33c5bc0 100755
|
|
--- a/src/UserInterface/ListView/klistview.cpp
|
|
+++ b/src/UserInterface/ListView/klistview.cpp
|
|
@@ -11,9 +11,15 @@ KListView::KListView(QWidget *parent):
|
|
|
|
KListView::~KListView()
|
|
{
|
|
- delete m_delegate;
|
|
- delete listmodel;
|
|
- delete pUkuiMenuInterface;
|
|
+ if (m_delegate) {
|
|
+ delete m_delegate;
|
|
+ m_delegate = nullptr;
|
|
+ }
|
|
+
|
|
+ if (listmodel) {
|
|
+ delete listmodel;
|
|
+ listmodel = nullptr;
|
|
+ }
|
|
}
|
|
|
|
void KListView::addData(QStringList data)
|
|
diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp
|
|
index 9bd82c4..e6027b6 100755
|
|
--- a/src/UserInterface/ListView/listview.cpp
|
|
+++ b/src/UserInterface/ListView/listview.cpp
|
|
@@ -37,7 +37,10 @@ ListView::ListView(QWidget *parent/*, int width, int height, int module*/):
|
|
|
|
ListView::~ListView()
|
|
{
|
|
- delete pUkuiMenuInterface;
|
|
+ if (pUkuiMenuInterface) {
|
|
+ delete pUkuiMenuInterface;
|
|
+ pUkuiMenuInterface = nullptr;
|
|
+ }
|
|
}
|
|
|
|
void ListView::initWidget()
|
|
--
|
|
2.33.0
|
|
|