Crash on calling GtkLabel.set_markup() with :track-visited-links == TRUE inside ::activate_link handler
Steps to reproduce
I tried this with gtk builder. An empty window with a label and a link as markup. When handling the 'activate_link' signal and changing the label text with 'set-markup' inside the handler and 'track_visited_links' set for the label, the program segfaults. The link markup string used was "<a href="b">b". Inside the handler 'true' is returned.
Version information
Tested on debian sid (testing) with gtk 3.24.1-2
Warnings
no warnings
Backtrace
no usable stacktrace with gdb for me
Full code example
-----------
main.cpp
-----------
gboolean callback (GtkLabel *label,
gchar *uri,
gpointer user_data)
{
std::cout << uri << "\n";
gtk_label_set_markup(label, "<a href=\"b\">b</a>");
return true;
}
int main(int argc, char** argv) {
gtk_init(&argc, &argv);
GtkBuilder* builder = gtk_builder_new_from_file ("./main.glade");
GObject* mainWindow = gtk_builder_get_object(builder, "mainWindow");
GObject* label = gtk_builder_get_object(builder, "label");
gtk_label_set_markup(GTK_LABEL(label), "<a href=\"b\">b</a>");
g_signal_connect(G_OBJECT(label), "activate-link", G_CALLBACK(callback), NULL);
gtk_widget_show_all(GTK_WIDGET(mainWindow));
gtk_main();
}
--------------
main.glade
--------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkWindow" id="mainWindow">
<property name="can_focus">False</property>
<property name="default_width">440</property>
<property name="default_height">250</property>
<property name="urgency_hint">True</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="width_request">50</property>
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
</interface>
Edited by Daniel Boles