kiran-menu/0001-fix-coredump-Fix-the-coredump-problem-caused-by-Rece.patch
tangjie02 8b586f61a3 Fix the coredump problem caused by RecentFilesListBox::load
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
2022-08-25 19:13:04 +08:00

48 lines
1.8 KiB
Diff

From 6da7f67dbc6e4d1226a96768256db1c903cf7e95 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 11 Aug 2022 15:27:59 +0800
Subject: [PATCH 1/2] fix(coredump): Fix the coredump problem caused by
RecentFilesListBox::load
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复由RecentFilesListBox::load回调函数导致的崩溃问题
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/menu/recent-files-list-box.cpp | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/menu/recent-files-list-box.cpp b/src/menu/recent-files-list-box.cpp
index 86ffd60..3ae481e 100644
--- a/src/menu/recent-files-list-box.cpp
+++ b/src/menu/recent-files-list-box.cpp
@@ -26,12 +26,7 @@ RecentFilesListBox::RecentFilesListBox() : filter_pattern("*")
get_style_context()->add_class("menu-recent-list");
/* 最近访问文件列表发生变化时重新加载 */
- Gtk::RecentManager::get_default()->signal_changed().connect(
- [this]() {
- KLOG_DEBUG("The recent files are changed.");
- this->load();
- });
-
+ Gtk::RecentManager::get_default()->signal_changed().connect(sigc::mem_fun(this, &RecentFilesListBox::load));
load();
}
@@ -180,7 +175,8 @@ Gtk::Widget *RecentFilesListBox::create_recent_item(const Glib::RefPtr<Gtk::Rece
widget->set_tooltip_text(item->get_display_name());
widget->get_style_context()->add_class("row-box");
widget->signal_button_press_event().connect_notify(
- [widget, context_menu, this](const GdkEventButton *button_event) -> void {
+ [widget, context_menu, this](const GdkEventButton *button_event) -> void
+ {
const GdkEvent *event = (const GdkEvent *)button_event;
if (gdk_event_triggers_context_menu(event))
{
--
2.33.0