qulogic/talkatu

Parents 6b7ad96b0eb5
Children e7dc9f018169
Fix a typo and fix some issues with tag list cleanup/iterating
--- a/talkatu/talkatuview.c Sun Jul 14 23:35:35 2019 -0500
+++ b/talkatu/talkatuview.c Mon Jul 15 02:13:18 2019 -0500
@@ -59,7 +59,7 @@
GtkTextMark *context_mark;
/* we cache the cursor that's displayed while hovering over a link as well
- * the tag for linux/anchors to avoid extra lookups.
+ * the tag for links/anchors to avoid extra lookups.
*/
GdkCursor *cursor_hand;
GtkTextTag *tag_anchor;
@@ -88,11 +88,11 @@
*****************************************************************************/
static gchar *
talkatu_view_url_from_iter(TalkatuView *view, GtkTextIter *iter) {
- GSList *tags = NULL, *tag = NULL;
+ GSList *tag = NULL;
gchar *url = NULL;
- tags = gtk_text_iter_get_tags(iter);
- for(tag = tags; tag != NULL; tag = g_slist_delete_link(tags, tag)) {
+ tag = gtk_text_iter_get_tags(iter);
+ for(; tag != NULL; tag = g_slist_delete_link(tag, tag)) {
if(tag->data == NULL) {
continue;
}
@@ -102,6 +102,7 @@
break;
}
}
+ g_slist_free(tag);
return url;
}