mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
gtk-demo: Plug a memory leak
This commit is contained in:
parent
5379a4bf34
commit
b622745501
@ -501,7 +501,7 @@ fontify (const char *format,
|
||||
char *theme;
|
||||
gboolean prefer_dark;
|
||||
const char *style_arg;
|
||||
const char *text;
|
||||
char *text;
|
||||
GtkTextIter start, end;
|
||||
GBytes *bytes;
|
||||
GError *error = NULL;
|
||||
@ -553,7 +553,7 @@ fontify (const char *format,
|
||||
|
||||
gtk_text_buffer_get_bounds (source_buffer, &start, &end);
|
||||
text = gtk_text_buffer_get_text (source_buffer, &start, &end, TRUE);
|
||||
bytes = g_bytes_new_static (text, strlen (text));
|
||||
bytes = g_bytes_new_take (text, strlen (text));
|
||||
|
||||
#ifdef HAVE_GIO_UNIX
|
||||
/* Work around https://gitlab.gnome.org/GNOME/glib/-/issues/2182 */
|
||||
@ -570,4 +570,5 @@ fontify (const char *format,
|
||||
NULL,
|
||||
fontify_finish,
|
||||
g_object_ref (source_buffer));
|
||||
g_bytes_unref (bytes);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user