forked from AuroraMiddleware/gtk
gtk-demo: Don't leak the markup
This commit is contained in:
parent
e0786a4a00
commit
2d72ba21ce
@ -319,13 +319,13 @@ fontify (const char *format,
|
||||
bytes = fontify_text (format, text);
|
||||
if (bytes)
|
||||
{
|
||||
const char *markup;
|
||||
char *markup;
|
||||
gsize len;
|
||||
|
||||
markup = g_bytes_get_data (bytes, &len);
|
||||
markup = g_bytes_unref_to_data (bytes, &len);
|
||||
gtk_text_buffer_delete (source_buffer, &start, &end);
|
||||
gtk_text_buffer_insert_markup (source_buffer, &start, markup, len);
|
||||
g_bytes_unref (bytes);
|
||||
g_free (markup);
|
||||
}
|
||||
|
||||
g_free (text);
|
||||
|
Loading…
Reference in New Issue
Block a user