From: Matthias Clasen Date: Wed, 11 Jan 2023 03:20:57 +0000 (-0500) Subject: texthistory: Avoid g_autofree X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~8^2~74 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=41aeff331d4f8121fda17a3a47eb72a7a4e26b85;p=gtk4.git texthistory: Avoid g_autofree msvc does not like it, unfortunately. --- diff --git a/gtk/gtktexthistory.c b/gtk/gtktexthistory.c index afb7f90282..614724112a 100644 --- a/gtk/gtktexthistory.c +++ b/gtk/gtktexthistory.c @@ -156,8 +156,6 @@ gtk_text_history_printf_action (Action *action, GString *str, guint depth) { - g_autofree char *escaped = NULL; - gtk_text_history_printf_space (str, depth); g_string_append_printf (str, "%s {\n", action_kind_name (action->kind)); @@ -177,31 +175,41 @@ gtk_text_history_printf_action (Action *action, case ACTION_KIND_DELETE_KEY: case ACTION_KIND_DELETE_PROGRAMMATIC: case ACTION_KIND_DELETE_SELECTION: - gtk_text_history_printf_space (str, depth+1); - g_string_append_printf (str, "begin: %u\n", action->u.delete.begin); - gtk_text_history_printf_space (str, depth+1); - g_string_append_printf (str, "end: %u\n", action->u.delete.end); - gtk_text_history_printf_space (str, depth+1); - g_string_append (str, "selection {\n"); - gtk_text_history_printf_space (str, depth+2); - g_string_append_printf (str, "insert: %d\n", action->u.delete.selection.insert); - gtk_text_history_printf_space (str, depth+2); - g_string_append_printf (str, "bound: %d\n", action->u.delete.selection.bound); - gtk_text_history_printf_space (str, depth+1); - g_string_append (str, "}\n"); - gtk_text_history_printf_space (str, depth+1); - escaped = g_strescape (istring_str (&action->u.delete.istr), NULL); - g_string_append_printf (str, "text: \"%s\"\n", escaped); + { + char *escaped; + + gtk_text_history_printf_space (str, depth+1); + g_string_append_printf (str, "begin: %u\n", action->u.delete.begin); + gtk_text_history_printf_space (str, depth+1); + g_string_append_printf (str, "end: %u\n", action->u.delete.end); + gtk_text_history_printf_space (str, depth+1); + g_string_append (str, "selection {\n"); + gtk_text_history_printf_space (str, depth+2); + g_string_append_printf (str, "insert: %d\n", action->u.delete.selection.insert); + gtk_text_history_printf_space (str, depth+2); + g_string_append_printf (str, "bound: %d\n", action->u.delete.selection.bound); + gtk_text_history_printf_space (str, depth+1); + g_string_append (str, "}\n"); + gtk_text_history_printf_space (str, depth+1); + escaped = g_strescape (istring_str (&action->u.delete.istr), NULL); + g_string_append_printf (str, "text: \"%s\"\n", escaped); + g_free (escaped); + } break; case ACTION_KIND_INSERT: - gtk_text_history_printf_space (str, depth+1); - g_string_append_printf (str, "begin: %u\n", action->u.insert.begin); - gtk_text_history_printf_space (str, depth+1); - g_string_append_printf (str, "end: %u\n", action->u.insert.end); - gtk_text_history_printf_space (str, depth+1); - escaped = g_strescape (istring_str (&action->u.insert.istr), NULL); - g_string_append_printf (str, "text: \"%s\"\n", escaped); + { + char *escaped; + + gtk_text_history_printf_space (str, depth+1); + g_string_append_printf (str, "begin: %u\n", action->u.insert.begin); + gtk_text_history_printf_space (str, depth+1); + g_string_append_printf (str, "end: %u\n", action->u.insert.end); + gtk_text_history_printf_space (str, depth+1); + escaped = g_strescape (istring_str (&action->u.insert.istr), NULL); + g_string_append_printf (str, "text: \"%s\"\n", escaped); + g_free (escaped); + } break; case ACTION_KIND_GROUP: