[libadwaita] AdwApplication: Fix memory leak in update_stylesheet
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita] AdwApplication: Fix memory leak in update_stylesheet
- Date: Mon, 30 Aug 2021 13:53:12 +0000 (UTC)
commit fcf62885bb28ec1da95d209c7de4bdaa3aef8746
Author: Julian Richen <julian richen io>
Date: Sat Aug 28 15:25:06 2021 -0400
AdwApplication: Fix memory leak in update_stylesheet
GtkSettings::gtk-theme-name, or any property returned by GtkSettings'
get_property, is g_value_copy-ed to the provided variable (theme_name).
Switching const char to a g_autofree gchar * to automatically free the
variable once out of scope.
src/adw-application.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/adw-application.c b/src/adw-application.c
index be283290..4a1ae76f 100644
--- a/src/adw-application.c
+++ b/src/adw-application.c
@@ -70,7 +70,7 @@ update_stylesheet (AdwApplication *self)
{
AdwApplicationPrivate *priv = adw_application_get_instance_private (self);
gboolean is_dark, is_hc, is_hc_dark;
- const char *theme_name;
+ g_autofree gchar *theme_name;
g_object_get (gtk_settings_get_default (),
"gtk-theme-name", &theme_name,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]