Fix memory leak due to notification area
Signed-off-by: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
This commit is contained in:
parent
52aecf88d3
commit
7d95355a8f
103
0001-fix-tray-Fix-memory-leak-due-to-notification-area.patch
Normal file
103
0001-fix-tray-Fix-memory-leak-due-to-notification-area.patch
Normal file
@ -0,0 +1,103 @@
|
||||
From ef54af3c33b1e779a3fc11ff5925ffe07c137958 Mon Sep 17 00:00:00 2001
|
||||
From: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
|
||||
Date: Thu, 1 Dec 2022 11:21:44 +0800
|
||||
Subject: [PATCH] fix(tray): Fix memory leak due to notification area.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复由于通知区域导致内存泄漏的问题
|
||||
|
||||
Closes #I63Q6H
|
||||
|
||||
Signed-off-by: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
|
||||
---
|
||||
src/tray/kiran-notify-icon-window.c | 3 +++
|
||||
src/tray/kiran-sn-icon.c | 4 ++++
|
||||
src/tray/kiran-tray.c | 2 ++
|
||||
src/tray/kiran-x11-tray-icon.cpp | 6 +-----
|
||||
4 files changed, 10 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/tray/kiran-notify-icon-window.c b/src/tray/kiran-notify-icon-window.c
|
||||
index 07fe89a..37381f4 100644
|
||||
--- a/src/tray/kiran-notify-icon-window.c
|
||||
+++ b/src/tray/kiran-notify-icon-window.c
|
||||
@@ -198,6 +198,7 @@ kiran_notify_icon_window_focus_in_event(GtkWidget *widget,
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ g_list_free(children);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -232,6 +233,7 @@ kiran_notify_icon_window_focus_out_event(GtkWidget *widget,
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ g_list_free(children);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -415,6 +417,7 @@ kiran_notify_icon_window_icons_refresh(KiranNotifyIconWindow *window,
|
||||
}
|
||||
|
||||
gtk_widget_set_size_request(GTK_WIDGET(window), max_row * 40, (row + 1) * 40);
|
||||
+ g_list_free(children);
|
||||
}
|
||||
|
||||
static void
|
||||
diff --git a/src/tray/kiran-sn-icon.c b/src/tray/kiran-sn-icon.c
|
||||
index f312458..a36040d 100644
|
||||
--- a/src/tray/kiran-sn-icon.c
|
||||
+++ b/src/tray/kiran-sn-icon.c
|
||||
@@ -542,6 +542,10 @@ update(KiranSnIcon *icon)
|
||||
}
|
||||
|
||||
gtk_image_set_from_surface(GTK_IMAGE(priv->image), surface);
|
||||
+ if(surface)
|
||||
+ {
|
||||
+ cairo_surface_destroy(surface);
|
||||
+ }
|
||||
g_free(priv->icon);
|
||||
priv->icon = g_strdup(priv->icon_name);
|
||||
}
|
||||
diff --git a/src/tray/kiran-tray.c b/src/tray/kiran-tray.c
|
||||
index c169a1e..9b40d96 100644
|
||||
--- a/src/tray/kiran-tray.c
|
||||
+++ b/src/tray/kiran-tray.c
|
||||
@@ -227,6 +227,7 @@ gsettings_changed_panel_icon_ids(GSettings *settings,
|
||||
|
||||
g_strfreev(panel_icon_ids);
|
||||
}
|
||||
+ g_list_free(children);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -494,6 +495,7 @@ kiran_tray_icons_refresh(KiranTray *tray)
|
||||
NULL);
|
||||
col++;
|
||||
}
|
||||
+ g_list_free(children);
|
||||
}
|
||||
|
||||
static void
|
||||
diff --git a/src/tray/kiran-x11-tray-icon.cpp b/src/tray/kiran-x11-tray-icon.cpp
|
||||
index b31a97b..63e6a80 100644
|
||||
--- a/src/tray/kiran-x11-tray-icon.cpp
|
||||
+++ b/src/tray/kiran-x11-tray-icon.cpp
|
||||
@@ -535,11 +535,7 @@ kiran_x11_tray_icon_new(Window icon_window)
|
||||
icon->priv->has_desktop = FALSE;
|
||||
}
|
||||
}
|
||||
- else
|
||||
- {
|
||||
- g_free(res_name);
|
||||
- }
|
||||
-
|
||||
+ g_free(res_name);
|
||||
g_free(res_class);
|
||||
|
||||
return GTK_WIDGET(icon);
|
||||
--
|
||||
2.36.1
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: kiran-menu
|
||||
Version: 2.3.0
|
||||
Release: 12
|
||||
Release: 13
|
||||
Summary: Applets for mate panel from Kiran Desktop
|
||||
|
||||
License: MulanPSL-2.0
|
||||
@ -18,6 +18,7 @@ Patch1008: 0001-fix-tray-Fix-the-icon-location-error-when-system-res.patch
|
||||
Patch1009: 0001-fix-tray-Fix-the-dbus-icon-can-not-scaled-when-syste.patch
|
||||
Patch1010: 0001-feature-menu-Add-flat-class-for-button-to-keep-consi.patch
|
||||
Patch1011: 0001-fix-menu-Fix-that-the-category-overlaps-the-search-b.patch
|
||||
Patch1012: 0001-fix-tray-Fix-memory-leak-due-to-notification-area.patch
|
||||
|
||||
|
||||
BuildRequires: cmake > 3.0
|
||||
@ -98,6 +99,9 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Dec 01 2022 wangxiaoqing <wangxiaoqing@kylinsec.com.cn> - 2.3.0-13
|
||||
- KYOS-B: Fix memory leak due to notification area.(#I63Q6H)
|
||||
|
||||
* Tue Nov 15 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-12
|
||||
- KYOS-B: Fix that the category overlaps the search box after the start menu collapses the category list.(I60PSI)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user