[gnome-shell] st: Don't leak st_describe_actor strings



commit 8e05fa2728be2bb19ae1ea782ae1e5968b9e0fd0
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Wed Jun 17 17:31:59 2020 +0800

    st: Don't leak st_describe_actor strings
    
    Hopefully this code doesn't get hit much. And it does seem to be the
    only user of the function.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1319

 src/st/st-widget.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 615d5e4772..9efffbd762 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -601,8 +601,11 @@ st_widget_get_theme_node (StWidget *widget)
 
       if (stage == NULL)
         {
+          g_autofree char *desc = st_describe_actor (CLUTTER_ACTOR (widget));
+
           g_critical ("st_widget_get_theme_node called on the widget %s which is not in the stage.",
-                      st_describe_actor (CLUTTER_ACTOR (widget)));
+                      desc);
+
           return g_object_new (ST_TYPE_THEME_NODE, NULL);
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]