Commit 1e3af04d authored by Sébastien Wilmet's avatar Sébastien Wilmet

gtk_text_buffer_create_tag(): returns NULL on failure

Returns NULL in case of a duplicated tag name in the tag table. It is
still a programmer error to duplicate a name, but if it happens the
behavior is a little nicer (and hopefully doesn't crash).

https://bugzilla.gnome.org/show_bug.cgi?id=614717
parent 68ad33cb
......@@ -2493,7 +2493,11 @@ gtk_text_buffer_create_tag (GtkTextBuffer *buffer,
tag = gtk_text_tag_new (tag_name);
gtk_text_tag_table_add (get_table (buffer), tag);
if (!gtk_text_tag_table_add (get_table (buffer), tag))
{
g_object_unref (tag);
return NULL;
}
if (first_property_name)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment